In addition to Weibo, there is also WeChat
Please pay attention

WeChat public account
Shulou
2025-11-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces the example analysis of kakfa configuration parameter Producer, which is very detailed and has certain reference value. Friends who are interested must finish it!
Serializer.class
Default value: kafka.serializer.DefaultEncoder
You must implement the kafka.serializer.Encoder interface to encode T-type objects into kafka message
Key.serializer.class
Default value: serializer.class
Serializer class of the key object
Partitioner.class
Default value: kafka.producer.DefaultPartitioner
Must implement kafka.producer.Partitioner and provide a partition policy according to Key
Producer.type
Default value: sync
Specifies whether messages are sent synchronously or asynchronously. Kafka.producer.AyncProducer for batch transmission of asynchronous asyc and kafka.producer.SyncProducer for synchronous sync
Metadata.broker.list
Default value: boker list
Use this parameter to pass in boker and static information for the partition, such as host1:port1,host2:port2, which can be part of the total boker
Compression.codec
Default value: NoCompressionCodec
Message compression, no compression by default
Compressed.topics
Default value: null
When compression is set, you can specify a specific topic compression, or all compression if specified
Message.send.max.retries
Default value: 3
Maximum number of attempts to send messages
Retry.backoff.ms
Default value: 300
Additional interval time for each attempt
Topic.metadata.refresh.interval.ms
Default value: 600000
The time to get metadata on a regular basis. Producer will also actively obtain metadata when the partition is lost and leader is not available. If 0, the metadata will be obtained every time a message is sent. It is not recommended. If it is a negative value, the metadata is obtained only if it fails.
Queue.buffering.max.ms
Default value: 5000
The maximum time of cached data in producer queue, only for asyc
Queue.buffering.max.message
Default value: 10000
The maximum number of messages cached by producer, only for asyc
Queue.enqueue.timeout.ms
Default value:-1
Discarded when queue is full, negative value is queue full block, positive value is the corresponding time of queue full block, only for asyc
Batch.num.messages
Default value: 200
The number of messages in a batch, only for asyc
Request.required.acks
Default value: 0
0 means that producer does not need to wait for confirmation from leader, 1 means that leader is required to confirm the local log written to it and confirm immediately, and-1 means that all backups are completed. Only for sync
Request.timeout.ms
Default value: 10000
Confirm timeout
The above is all the contents of the article "sample Analysis of kakfa configuration parameters Producer". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope





About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.