kafka-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Keylis <vkeylis2...@gmail.com>
Subject Send multiple messages to multiple topics in one request
Date Tue, 04 Jun 2013 07:36:20 GMT
Version 7 of Kafka allowed to send messages to multiple topics within one
request. I assume I can do
samething in version 8, am I correct? Does my code piece look correct?
List<KeyedMessage<String, String>> topicsMsgsList = new ArrayList();
KeyedMessage<String, String> data1 = new KeyedMessage<String,
String>(topic1, msg);
KeyedMessage<String, String> data2 = new KeyedMessage<String,
String>(topic2, msg);
topicsMsgsList.add(data1);
topicsMsgsList.add(data2);
 producer.send( topicsMsgsList );

Thanks,
Vadim

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message