Apache Kafka®, Kafka Streams, and ksqlDB to demonstrate real use cases - 3 (message-ordering)
How to maintain message ordering and no message duplication Question: How can I maintain the order of messages and prevent message duplication in a Kafka topic partition? Example use case: If your application needs to maintain ordering of messages with no duplication, you can enable your Apache Kafka producer for idempotency. An idempotent producer has a unique producer ID and uses sequence IDs for each message, which allows the broker to ensure it is committing ordered messages with no duplication, on a per partition basis. Short Answer Set the ProducerConfig configuration parameters relevant to the idempotent producer: enable.idempotence= true acks=all Initialize the project mkdir message-ordering && cd message-ordering Make the following directories to set up its structure: mkdir src test 2 Get Confluent Platform Next, create the following docker-compose.yml file to obtain Confluent Platform (this tutorial uses just ZooKeeper and the Kafka broker): ---version: '2...