How to produce messages to selected partition using kafka-console-producer?

后端 未结 5 932
忘掉有多难
忘掉有多难 2021-02-01 06:40

According to the Kafka documentation:

The producer is responsible for choosing which message to assign to which partition within the topic.

5条回答
  •  甜味超标
    2021-02-01 07:29

    C:\arunsingh\demo\kafka_2.13-2.4.0\bin\windows>kafka-console-producer.bat --broker-list 127.0.0.1:9094 --topic arun_topic --property parse.key=true --property key.separator=, --producer-property acks=all
    >myKey1, Message with key
    >myKey2, Message with key 2
    >
    

提交回复
热议问题