Reputation: 117
Can anyone shed some light on the number of connections and what type of connections are made by the Kafka Java producers and Kafka Java consumers to a Kafka cluster.
Are the number of connections based on the number of topics or partitions or brokers in the cluster?
Upvotes: 1
Views: 4478
Reputation: 10075
Each consumer/producer needs to be connected to the broker which is leader for the partition that the consumer/producer wants to read/write. It means that a client doesn't need to be connected to all brokers inside a cluster but just the brokers needed for reading/sending messages. During the initial configuration, we provide a list of brokers to connect to (which could be even only one). Using such broker(s), the client gets metadata information about the topic/partitions it wants to use and where they are placed (other brokers in the cluster). Such connections need to be in place for client working on the desired topic/partitions.
Upvotes: 1