You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Usman Liaqat <us...@solitontechnologies.com> on 2016/10/10 11:55:56 UTC

Kafka producer 0.9.0.x if not closed.

Hi ,

I am using kafka 0.9.0.x and in a multithreaded system I have created only
one instance of Kafka producer.

When I say producer.close(); it only closes communication and cannot send
the messages on topic.

BUT why its object is still valid if we cannot send requests to it. 

 

Moreover, I can understand kafka producer threads opened and not closed will
leak resources,

Why kafka cannot have a timer on Producer thread if it is idle close it and
make it available for GC and on need recreate it?

 

Thanks 

Usman.