Kafka: a non-idempotent producer reorders on retry

With retries enabled and more than one request in flight, a failed batch is resent behind batches that already succeeded. The records arrive in the log in an order the producer never sent - and duplicates too.

Full code & output

This topic is available to PRO members.

Open this topic Go PRO Sign in Create a free account
More in KAFKA

Run this yourself in the Online Java Compiler, spin up a live REST API in the API Sandbox, or practise with Java interview questions.

Published 2026-08-25

© Java Coding Hub · About · Contact · Privacy · Terms