It's better to use single producer.

closing() and recreating only result in unnecessary overhead and does
not give you any advantages.


-Matthias

On 12/18/17 3:12 AM, Shubham Dhoble wrote:
> I am accessing kafka through java code. The use case is, I want to publish
> stream of messages on two kafka topic, which would be in a transaction.
> 
> My point of concern is would it be better to use one single global kafka
> producer for all messages or invoking and deleting a new kafkaPoducer for
> every new message to publish?
> 
> What would be the pros and cons of new producer creation and deletion for
> every request and can a single producer handle all transactional calls.
> 

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to