Improving performance of Kafka Producer

前端 未结 3 1516
囚心锁ツ
囚心锁ツ 2021-01-15 07:55

We\'re running on apache kafka 0.10.0.x and spring 3.x and cannot use spring kafka as it is supported with spring framework version 4.x.

Therefore, we are using the

3条回答
  •  南方客
    南方客 (楼主)
    2021-01-15 08:43

    The two important configuration parameters of kafka producer are 'batch.size' and 'linger.ms'. So you basically have a choice: you can wait until the producer batch is full, or the producer time out.

    • batch.size – This is an upper limit of how many messages Kafka Producer will attempt to batch before sending – specified in bytes.

    • linger.ms – How long will the producer wait before sending in order to allow more messages to get accumulated in the same batch.

    It depends on your use case, but I would suggest to take a closer look on these parameters.

提交回复
热议问题