-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Discussed in #1947
Originally posted by hannybNdq September 20, 2021
Affects Version(s): \2.7.1
Nullpointer in DelegatingInvocableHandler, lookup in "handlerReturnsMessage" map fails.
Two handlers (annotated with @KafkaHandler) within the same class (annotated with @KafkaListener) listening for different payload types:
@KafkaHandler
private void onA(final A descriptor) {
...
}
@KafkaHandler
private void onB(final B descriptor) {
...
}
After running successfully for weeks at a time we sometimes get a Nullpointer in the DelegatingInvocableHandler
at return new InvocationResult(result, replyTo, (Boolean)this.handlerReturnsMessage.get(handler))
when looking up one of the handlers.
For example when looking up the onA
handler the "handlerReturnsMessage" map contains the onB
handler and null so the lookup of onA
returns null.
We have seen the lookup fail for both the onA
and onB
handlers, never both at once.
When this fails it usually only happens for one or two Kubernetes pods out of the bunch.
After restarting the failing pod the handlers can both consume again.
Spring Kafka version: 2.7.1
KAFKA_CONCURRENCY: 12
The number of topic partitions is higher than the number of running pods * concurrency.
Any ideas on why this happens?