Re: producer transaction and threading model

2019-11-20 Thread Edward Capriolo
Spring framework works around this by providing a method like doInTransaction( listofstuff). Behind the scenes it manages a pool of transactional producers with ids like transaction_prefix + id. So each call to dointransaction may initiate a transaction. On Friday, November 15, 2019, Matthias

Re: producer transaction and threading model

2019-11-14 Thread Matthias J. Sax
That's correct. And each would need to use a different `transactional.id`. -Matthias On 11/14/19 11:17 AM, Anindya Haldar wrote: > Thanks for the information. Does that mean that each producer thread, in case > it wants to have its own transactions, should use its own instance of >

Re: producer transaction and threading model

2019-11-14 Thread Anindya Haldar
Thanks for the information. Does that mean that each producer thread, in case it wants to have its own transactions, should use its own instance of KafkaProducer? Sincerely, Anindya Haldar Oracle Responsys > On Nov 13, 2019, at 11:31 PM, Matthias J. Sax wrote: > > That is not possible. A

Re: producer transaction and threading model

2019-11-13 Thread Matthias J. Sax
That is not possible. A producer can only have a single open transaction. If your example, the call of thread-2 to start a new transactions would fail and an exception would be thrown. -Matthias On 11/13/19 10:52 AM, Anindya Haldar wrote: > The producer API doc >

producer transaction and threading model

2019-11-13 Thread Anindya Haldar
The producer API doc (https://kafka.apache.org/23/javadoc/index.html?org/apache/kafka/clients/producer/KafkaProducer.html ) says that KafkaProducer is thread safe. What I was trying to figure