Skip to content

1.0.4 - Fix in poll() behavior to avoid message loss during consumption

Compare
Choose a tag to compare
@abhishekmendhekar abhishekmendhekar released this 11 Mar 23:26
64c130b

Symptom
Current poll() behavior will catch and skip offset on message processing exception and throw the suppressed exception in next poll(). If poll() is not called again and offset is skipped then the user never gets a chance to handle the exception.
All Kafka exceptions are treated as RuntimeException and the message loss can happen if some internal client thread is interrupted which is not a processing exception but an interrupt exception but since its a Kafka exception it is treated as RuntimeException. This caused the offset to move forward without user seing the actual InterruptException and during shutdown if the user commits they will never see the offset that was interrupted.