Why do we need this improvement?
Motivation
Kafka topics frequently require different settings per environment:
- Lower partitions / replicas in dev environments
- Shorter retention policies in non-production
- Reduced storage limits for cost control
- Different cleanup strategies
Without native support, teams can not use AsyncAPI as the single source of truth for both API contract and infrastructure deployment. They typically rely on:
- External deployment logic
- Custom templating systems
This increases complexity and reduces portability. Embedding overrides improves clarity, reduces duplication, and aligns infrastructure intent with the API contract.
How will this change help?
Summary
This proposal introduces a Kafka channel binding property that enables environment-specific overrides of topic configuration within an AsyncAPI document. This property provides a standardized, explicit mechanism to declare such differences directly within channel bindings so AsyncAPI can be the single source of truth for both API contract and infrastructure deployment.
Screenshots
No response
How could it be implemented/designed?
Proposed Property
Introduce a new property at the Kafka channel binding level:
channelBindings:
someKafkaChannelBinding:
kafka:
partitions: 20
replicas: 3
topicConfiguration:
cleanup.policy: ["delete", "compact"]
retention.ms: 604800000
retention.bytes: 1000000000
delete.retention.ms: 86400000
max.message.bytes: 1048588
envServerOverrides:
dev:
partitions: 1
replicas: 1
topicConfiguration:
cleanup.policy: ["delete"]
retention.ms: 604800
staging:
partitions: 3
replicas: 2
Semantics
- The base
kafka binding defines the default topic configuration.
env-server-overrides defines partial overrides applied conditionally.
- Keys under
env-server-overrides correspond to server names defined in the AsyncAPI document.
- Each override object follows the same schema as the Kafka channel binding but allows partial definitions.
- Overrides are applied as a merge on top of the base binding.
Resolution Rules
When using AsyncAPI channel bindings to provision Kafka topics, the following rules apply:
- Identify the active server (tooling / runtime decision).
- Match the server name against
env-server-overrides.
- Merge override fields onto the base Kafka binding.
- Unspecified properties inherit base values.
Validation Considerations
- Override keys are expected to correspond to existing
servers entries.
- Override objects should follow the Kafka channel binding structure.
Naming Discussion
The proposed name is env-server-overrides.
Rationale:
env communicates intent (environment-dependent behavior)
server aligns with AsyncAPI's existing server model
overrides clearly expresses merge semantics
env-server-overrides explicitly ties overrides to AsyncAPI server definitions rather than arbitrary environment labels.
Future Considerations
- Would this property be useful for other protocols?
🚧 Breaking changes
No
👀 Have you checked for similar open issues?
🏢 Have you read the Contributing Guidelines?
Are you willing to work on this issue?
Yes I am willing to submit a PR!
Why do we need this improvement?
Motivation
Kafka topics frequently require different settings per environment:
Without native support, teams can not use AsyncAPI as the single source of truth for both API contract and infrastructure deployment. They typically rely on:
This increases complexity and reduces portability. Embedding overrides improves clarity, reduces duplication, and aligns infrastructure intent with the API contract.
How will this change help?
Summary
This proposal introduces a Kafka channel binding property that enables environment-specific overrides of topic configuration within an AsyncAPI document. This property provides a standardized, explicit mechanism to declare such differences directly within channel bindings so AsyncAPI can be the single source of truth for both API contract and infrastructure deployment.
Screenshots
No response
How could it be implemented/designed?
Proposed Property
Introduce a new property at the Kafka channel binding level:
Semantics
kafkabinding defines the default topic configuration.env-server-overridesdefines partial overrides applied conditionally.env-server-overridescorrespond to server names defined in the AsyncAPI document.Resolution Rules
When using AsyncAPI channel bindings to provision Kafka topics, the following rules apply:
env-server-overrides.Validation Considerations
serversentries.Naming Discussion
The proposed name is
env-server-overrides.Rationale:
envcommunicates intent (environment-dependent behavior)serveraligns with AsyncAPI's existing server modeloverridesclearly expresses merge semanticsenv-server-overridesexplicitly ties overrides to AsyncAPI server definitions rather than arbitrary environment labels.Future Considerations
🚧 Breaking changes
No
👀 Have you checked for similar open issues?
🏢 Have you read the Contributing Guidelines?
Are you willing to work on this issue?
Yes I am willing to submit a PR!