Did you try asynchronous produce? That should provide better performance because asynchronous produce doesn't block waiting for response.
BTW, what is your ack setting for producer? Dong On Fri, Dec 18, 2015 at 1:16 PM, Abel . <a...@amtech.mx> wrote: > Hi, > > I have this scenario where I need to send a message to multiple topics. I > create a single KafkaProducer, prepare the payload and then I call the send > method of the producer for each topic with the correspoding ProducerRecord > for the topic and the fixed message. However, I have noticed that this > procedure takes some time depending on the number of topics. For instance, > to send a message to 30 topics it takes more than 3s because each request > takes about 100ms to return from the send method. Is there a better way to > accomplish this same task? Any recommendation? > > Regards, > > Abel. >