Kafka Exception InterruptException
org.apache.kafka.common.errors.InterruptException
Non-retriable
Client
An unchecked wrapper for InterruptedException
Common Causes
- The thread running a blocking Kafka client call was interrupted (Thread.interrupt()), e.g. by an executor shutdownNow() or framework lifecycle
- Kafka wraps Java's InterruptedException in this unchecked exception so it propagates through the client API
Solutions
- Use consumer.wakeup() to stop a consumer cleanly instead of interrupting its thread
- On a thread pool, prefer shutdown() over shutdownNow() so in-flight Kafka work finishes before threads are interrupted
- Catch it at the loop boundary, restore the interrupt flag if appropriate, and close clients gracefully
Example Stack Trace
org.apache.kafka.common.errors.InterruptException: java.lang.InterruptedException
at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:294)
Caused by: java.lang.InterruptedExceptionRelated
Related Client exceptions: DisconnectException · LogTruncationException
Hitting
InterruptException in production? Conduktor Console gives you real-time visibility into clients, consumer groups, and broker health. Browse every Kafka exception or protocol error code.