-
What's the difference between the two parameters: "producer_batch_num" of kafka-logger and "batch_max_size" of batch-processor? I would like to use kafka-logger to record http requests into kafka. In order to decrease the commit frequency, it is suggested to send batch records to kafka other than sending records one by one. I have read the document and it makes me confused. https://apisix.apache.org/docs/apisix/3.2/plugins/kafka-logger/ https://apisix.apache.org/docs/apisix/3.2/batch-processor/ How should I config my settings to send batched records to kafka? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @mangolost! I'm here to help you with any bugs, questions, or contributions you have. Let's tackle this issue together! To configure your settings for sending batched records to Kafka using the
Configuration Steps:
Example Configuration:kafka-logger:
producer_batch_num: 200
producer_batch_size: 1048576
batch-processor:
batch_max_size: 1000 By setting these parameters, you can control the batching behavior to reduce the commit frequency to Kafka while efficiently processing logs. |
Beta Was this translation helpful? Give feedback.
Hey @mangolost! I'm here to help you with any bugs, questions, or contributions you have. Let's tackle this issue together!
To configure your settings for sending batched records to Kafka using the
kafka-logger
plugin and thebatch-processor
plugin, you need to understand the roles of the different parameters:producer_batch_num
(kafka-logger): Specifies the number of messages to be merged and sent to the Kafka server in a single batch. This controls how many individual messages are grouped together before being sent.producer_batch_size
(kafka-logger): Defines the maximum size of the batch in bytes. This limits the total size of the messages that can be sent in one batch.batch_ma…