Folks, I am trying to understand Idempotent Producer. I am using Kafka 2.13
I read https://www.cloudkarafka.com/blog/apache-kafka-idempotent-producer-avoiding-message-duplication.html
I went thru Kafka Spring boot course that said the following should be set up for Idempotent producer
configProps.put(ProducerConfig.ENABLE_IDEMPOTENCE_CONFIG, true); configProps.put(ProducerConfig.ACKS_CONFIG, "all"); configProps.put(ProducerConfig.MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION, 5); configProps.put(ProducerConfig.RETRIES_CONFIG, Integer.MAX_VALUE);
I also came to know that upon settings enable.idempotence=true rest of the other above configs are set automatically
With #2 I was not able to produce unique messages in Spring boot
Hence I wanted to try in console producer. I read How to enable idempotence in kafka-console-producer? and tried the below.
- As you see in the screenshot I am able to send two Apple - 01 and O - 01 messages. I was expecting the Producer to send these messages once.
Kindly let me know how can I make the producer remove duplicates? Any leads are much appreciated!