Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In this KIP, we propose adding topic-level acks, enabling users reuse a single KafkaProducer even when different topics require different acks settings. This change will reduce the need for multiple producers, which is particularly beneficial in resource-constrained environments.

Public Interfaces

We add a new config TOPIC_ACKS_CONFIG  and TOPIC_ACKS_DOC into ProducerConfig and define the format.

...

Name

Type

Importance

Default

Description

acks.topic.acksStringLOW
null

This configuration item will set acks for specific topics.

...

  • Adding a new configuration in  ProducerConfig :  acks.topic.acks,  By setting this configuration item, users can customize the acks for specific topic.
  • Behavior change:
    1. Attach topic-level acks to RecordAccumulator#TopicInfo.
    2. Return Map<Acks, List<ProducerBatch>> when RecordAccumulator#drainBatchesForOneNode is called.
    3. Finally, we can get the acks information and group same acks into List<ProducerBatch>> for a node in sender#sendProduceRequests and then send request.

...