You are viewing documentation for an older version (0.7) of Kafka. For up-to-date documentation, see the latest version.
Important configuration properties for the producer
Important configuration properties for the producer:
More details about producer configuration can be found in the scala class kafka.producer.ProducerConfig.
property | default | description |
|---|---|---|
| kafka.serializer.DefaultEncoder. This is a no-op encoder. The serialization of data to Message should be handled outside the Producer | class that implements the |
|
| class that implements the |
| sync | this parameter specifies whether the messages are sent asynchronously or not. Valid values are -
|
| null. Either this parameter or zk.connect needs to be specified by the user. | For bypassing zookeeper based auto partition discovery, use this config to pass in static broker and per-broker partition information. Format- |
| null. Either this parameter or broker.partition.info needs to be specified by the user | For using the zookeeper based automatic broker discovery, use this config to pass in the zookeeper connection url to the zookeeper cluster where the Kafka brokers are registered. |
| 102400 | the socket buffer size, in bytes |
| 5000 | the maximum time spent by |
| 30000 | The socket timeout in milliseconds |
| 30000 | the number of produce requests after which |
| 10 * 1000 * 1000 | the amount of time after which |
| 1000000 | the maximum number of bytes that the kafka.producer.SyncProducer can send as a single message payload |
| 0 (No compression) | This parameter allows you to specify the compression codec for all data generated by this producer. |
| null | This parameter allows you to set whether compression should be turned on for particular topics. If the compression codec is anything other than NoCompressionCodec, enable compression only for specified topics if any. If the list of compressed topics is empty, then enable the specified compression codec for all topics. If the compression codec is NoCompressionCodec, compression is disabled for all topics. |
| 3 | The producer using the zookeeper software load balancer maintains a ZK cache that gets updated by the zookeeper watcher listeners. During some events like a broker bounce, the producer ZK cache can get into an inconsistent state, for a small time period. In this time period, it could end up picking a broker partition that is unavailable. When this happens, the ZK cache needs to be updated. This parameter specifies the number of times the producer attempts to refresh this ZK cache. |
Options for Asynchronous Producers ( | ||
| 5000 | maximum time, in milliseconds, for buffering data on the producer queue. After it elapses, the buffered data in the producer queue is dispatched to the |
| 10000 | the maximum size of the blocking queue for buffering on the |
| 200 | the number of messages batched at the producer, before being dispatched to the |
|
| the class that implements |
| null | the |
|
| the class that implements |
| null | the |