Re: Single producer for stream or multiple producers

2017-12-18 Thread Matthias J. Sax
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 ka

Single producer for stream or multiple producers

2017-12-18 Thread Shubham Dhoble
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 ever