aniketpant
aniketpant

Reputation: 135

What are all the kafka producer properties?

Just new to kafka.
Today i was running some commands of kafka-console-producer.sh, i was using key value pair messages

bin/kafka-console-producer.sh --topic producer-demo --property "parse.key=true" --property "key.separator=:" --broker-list kafka1:9092

i am just curious where we can find producer property like i search
**"parse.key=true"** and
**"key.separator=:"** in
https://kafka.apache.org/documentation/#producerconfigs
There is no parameter like this is this custom parameter or predefined because i have to use this more and i can apply on this command

Upvotes: 0

Views: 8931

Answers (3)

Alfred
Alfred

Reputation: 21396

For a handy reference, let me list down the available arguments for kafka-console-producer. I hope you are looking for something like this;

  1. –batch-size <Integer: size>:- We are defining the single batch for sending the Number of messages
  2. –broker-list <String: broker-list>: -This is required options for the Kafka-console- producer, the broker list string in the form HOST: PORT
  3. –compression-codec [String: compression-codec]:- This option is used to compress either ‘none’ or ‘gzip’.If specified without a value, then it defaults to ‘gzip’
  4. –Help: – It will display the usage information.
  5. –metadata-expiry-ms<Long: metadata expiration interval>:- The period in milliseconds after which we force a refresh of metadata even if we haven’t seen any leadership changes. (Default: 300000).
  6. –producer-property <String: producer_prop>:-This parameter is used to set user-defined properties as key=value pair to the producer.
  7. –producer.config<String: config file>:-This is the properties file containing all configuration related to the producer.
  8. –property <String: prop>:- This attribute provides the liberty to pass user-defined properties to the message reader. These properties allow custom configuration and defined in the form of key=value.
  9. –request-required-acks<String: request required acks>:- The required acks of the producer requests (default: 1)
  10. –request-timeout-ms<Integer: request timeout ms>:- The ack timeout of the producer Value must be non-negative and non-zero (default: 1500).
  11. –Sync: – If a set message sends, requests to the brokers are synchronous, one at a time as they arrive.
  12. –timeout <Integer: timeouts>:- If set and the producer is running in asynchronous mode, this gives the maximum amount of time a message will queue awaiting sufficient batch size. The value is given in ms.
  13. –topic <String: topic>:- this option is required .basically, the topic id to produce messages to.
  14. –Version: -Display Kafka version.

Upvotes: 0

dung ta van
dung ta van

Reputation: 1026

You can find out the all properties of kafka producer in the ProducerConfig class

Upvotes: 1

OneCricketeer
OneCricketeer

Reputation: 192023

Those parameters in particular are not Producer properties (which you pass with --producer-property, and not --property). They are CLI arguments that you can really only find in the source code.

Upvotes: 0

Related Questions