You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by dhiraj prajapati <dh...@gmail.com> on 2016/06/30 10:03:43 UTC

How many connections per consumer/producer

Hi,
I am using new Kafka Consumer and Producer APIs (version 0.9.0.1)
I see that my consumer as well as producer has multiple connections
established with kafka brokers. Why is this so?
Does the consumer and producer APIs use connection pooling? If yes, where
do I configure the pool size?

Regards,
Dhiraj

Re: How many connections per consumer/producer

Posted by Ben Stopford <be...@confluent.io>.
Hi Dhiaraj

That shouldn’t be the case. As I understand it both the producer and consumer hold a single connection to each broker they need to communicate with. Multiple produce requests can be sent through a single connection in the producer (the number being configurable with max.in.flight.requests.per.connection and non-blocking io is used). Consumers (new consumer) send a single request to each broker.     

Hope that helps

B
> On 30 Jun 2016, at 11:03, dhiraj prajapati <dh...@gmail.com> wrote:
> 
> Hi,
> I am using new Kafka Consumer and Producer APIs (version 0.9.0.1)
> I see that my consumer as well as producer has multiple connections
> established with kafka brokers. Why is this so?
> Does the consumer and producer APIs use connection pooling? If yes, where
> do I configure the pool size?
> 
> Regards,
> Dhiraj