You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2022/10/06 15:09:00 UTC

[camel] branch main updated: CAMEL-18594: fixed a NPE on the master component

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


The following commit(s) were added to refs/heads/main by this push:
     new 1ed37327fa1 CAMEL-18594: fixed a NPE on the master component
1ed37327fa1 is described below

commit 1ed37327fa1cfc77465d63fb3feedc06a71a010f
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Thu Oct 6 16:18:30 2022 +0200

    CAMEL-18594: fixed a NPE on the master component
    
    This prevents the component from taking leadership if a resume strategy is unset for the route.
---
 .../src/main/java/org/apache/camel/component/master/MasterConsumer.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/camel-master/src/main/java/org/apache/camel/component/master/MasterConsumer.java b/components/camel-master/src/main/java/org/apache/camel/component/master/MasterConsumer.java
index 3db4b7c6980..a646bbed969 100644
--- a/components/camel-master/src/main/java/org/apache/camel/component/master/MasterConsumer.java
+++ b/components/camel-master/src/main/java/org/apache/camel/component/master/MasterConsumer.java
@@ -140,7 +140,7 @@ public class MasterConsumer extends DefaultConsumer implements ResumeAware {
             getEndpoint().getCamelContext().addStartupListener((StartupListener) delegatedConsumer);
         }
 
-        if (delegatedConsumer instanceof ResumeAware) {
+        if (delegatedConsumer instanceof ResumeAware && resumeStrategy != null) {
             final ResumeAware resumeAwareConsumer = (ResumeAware) delegatedConsumer;
             LOG.info("Setting up the resume adapter for the resume strategy in the delegated consumer");
             ResumeAdapter resumeAdapter = AdapterHelper.eval(clusterService.getCamelContext(), resumeAwareConsumer);