This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 1fda680e1231d344f35cab27ad2d5af91f8fffbb
Author: Rinaldo Pitzer JĂșnior <[email protected]>
AuthorDate: Mon Aug 1 15:07:06 2022 -0300

    CAMEL-18333: camel-kafka - avoid NPE during health-check
    
    The pollExceptionStrategy might be null if, for example, the
    KafkaConsumer has not been created due to an exception. In those cases,
    a NPE was being thrown during the health check.
---
 .../main/java/org/apache/camel/component/kafka/KafkaFetchRecords.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaFetchRecords.java
 
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaFetchRecords.java
index 2dcaf162b4f..266bf7a8f11 100644
--- 
a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaFetchRecords.java
+++ 
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaFetchRecords.java
@@ -515,7 +515,8 @@ public class KafkaFetchRecords implements Runnable {
     }
 
     private boolean isRecoverable() {
-        return (pollExceptionStrategy.canContinue() || isReconnect()) && 
isKafkaConsumerRunnable();
+        return (pollExceptionStrategy != null && 
pollExceptionStrategy.canContinue() || isReconnect())
+                && isKafkaConsumerRunnable();
     }
 
     // concurrent access happens here

Reply via email to