Kafka Error OUT_OF_ORDER_SEQUENCE_NUMBER
Error code 45 · Non-retriable Producer
The broker received an out of order sequence number.
Reviewed 2026-10-27 · 4.4.0 · source-reviewed. Source · Source
Common Causes
- The broker received an unexpected sequence number for a producer ID and epoch. The final application exception and the internal response need different handling.
Solutions
- Use the selected client’s idempotence constraints: Kafka Java 4.4 requires acks=all, retries>0 and max.in.flight.requests.per.connection<=5. This is a client configuration requirement, not a broker-version-only rule.
- An OutOfOrderSequenceException exposed to a transactional producer is fatal. For an idempotent producer, inspect the documented ordering/data-loss implications before continuing or recreating it. Do not blindly replay an ambiguous batch.
Diagnostic Commands
# Look for sequence number errors in logs
grep 'OUT_OF_ORDER_SEQUENCE\|OutOfOrderSequence\|sequence number' /var/log/kafka/server.log | tail -20
# Check for under-replicated partitions
kafka-topics.sh --bootstrap-server localhost:9092 --describe --topic <topic> 2>&1 | grep -E 'Isr|UnderReplicated'Related APIs
This error can be returned by: Produce
Java Exception
In the Java client this surfaces as OutOfOrderSequenceException.
Debugging Kafka errors? Conduktor Console gives you real-time visibility into your cluster. Explore all errors in the Error Decoder.