Skip to content

Conversation

@sevenup30
Copy link

This PR enhances the Kafka consumer configuration by adding support for connecting to multiple brokers instead of a single one.

In most non-local environments, Kafka clusters run with at least three brokers for high availability. This change allows our consumer to be aware of the entire cluster, as supported by the underlying AIOKafkaConsumer library.

Additionally, this PR introduces the client_id setting. This is a best practice for identifying and tracking the consumer's activity on the Kafka brokers, which is valuable for monitoring and debugging purposes.

Reference: AIOKafkaConsumer API Documentation

@ptoscano
Copy link
Contributor

Hi @sevenup30,

first of all, thanks for the PR!

On the actual code:

  • replacing the host and port parameters is a breaking change, and I'm not sure it is worth at this time (every usage of it by users would need to be changed); IMHO a backward-compatible addition would be better;
    • a potential idea could be to add servers as list of servers, and make it mutually exclusive with host+port (i.e. either specify the existing keys or the new one)
  • a comma-separated list as string does not seem very yaml-y; please make it as a proper list, so there is less need to deal with item splitting (in the source) or joining (by users)
  • the client_id addition seems fine; what do you think about splitting it in its own PR, so it can be easily reviewed and merged without waiting for the discussion on the API for multiple servers?

Thanks!

@github-actions github-actions bot added feature and removed feature labels Sep 19, 2025
@github-actions github-actions bot added feature and removed feature labels Sep 19, 2025
@sevenup30 sevenup30 changed the title feat: Add support for multiple Kafka brokers and client_id feat: Add support for multiple Kafka brokers Sep 23, 2025
@paspflue
Copy link

paspflue commented Oct 8, 2025

@sevenup30 what do you think about renaming brokers to bootstrap_servers? That would make it similar to the Kafka namings.

PS: I would also be interested in this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat New feature ore request feature

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants