Yesterday I was working with a team that was facing issue with their Kafka related code. The Kafka consumer was failing with the exception
[] ERROR [2022-11-22 08:32:52,853] com.abc.MyKakfaConsumer: Exception while processing events
! java.lang.NullPointerException: Cannot invoke "org.apache.kafka.common.header.Header.value()" because the return value of "org.apache.kafka.common.header.Headers.lastHeader(String)" is null
! at com.abc.MyKakfaConsumer.run(MyKakfaConsumer.java:83)
! at java.base/java.lang.Thread.run(Thread.java:833)
The consumer code looked like as shown below.
Continue reading “TIL #2: Kafka poison pill message and CommitFailedException”