zookeeper - Produce Kafka message to selected partition -



zookeeper - Produce Kafka message to selected partition -

according kafka documentation:

the producer responsible choosing message assign partition within topic.

therefore main question is:

how can send message selected partition using kafka-console-producer.sh (or kafka java client)?

i specify sort of 'partition id' @ message sending. such 'partition id' stored somewhere in zookeeper. know 1 value (in zookeeper) identifies kafka partition?

kafka-console-producer.sh doesn't back upwards producing messages particular partition out of box.

however should pretty straightforward update script pass parameter partition id , handle in custom partitioner described in post @chiron in modified version of kafka.tools.consoleproducer class.

take @ source code at:

https://apache.googlesource.com/kafka/+/refs/heads/trunk/bin/kafka-console-producer.sh https://apache.googlesource.com/kafka/+/refs/heads/trunk/core/src/main/scala/kafka/tools/consoleproducer.scala

zookeeper apache-kafka

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -