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

davsclaus pushed a commit to branch camel-2.x
in repository https://gitbox.apache.org/repos/asf/camel.git


View the commit online:
https://github.com/apache/camel/commit/814263ab37a3a3a8a57123ecff8710e0ded743c1

The following commit(s) were added to refs/heads/camel-2.x by this push:
     new 814263a  CAMEL-14173: camel-paho - Do not unsubscribe for durable 
topics when stopping. Thanks to Roland Beisel for reporting.
814263a is described below

commit 814263ab37a3a3a8a57123ecff8710e0ded743c1
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Wed Nov 20 21:28:51 2019 +0100

    CAMEL-14173: camel-paho - Do not unsubscribe for durable topics when 
stopping. Thanks to Roland Beisel for reporting.
---
 .../src/main/java/org/apache/camel/component/paho/PahoConsumer.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoConsumer.java
 
b/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoConsumer.java
index 3553110..6096dbb 100644
--- 
a/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoConsumer.java
+++ 
b/components/camel-paho/src/main/java/org/apache/camel/component/paho/PahoConsumer.java
@@ -84,8 +84,10 @@ public class PahoConsumer extends DefaultConsumer {
         super.doStop();
 
         if (getEndpoint().getClient().isConnected()) {
-            String topic = getEndpoint().getTopic();
-            getEndpoint().getClient().unsubscribe(topic);
+            if (getEndpoint().getConnectOptions().isCleanSession()) {
+                String topic = getEndpoint().getTopic();
+                getEndpoint().getClient().unsubscribe(topic);
+            }
         }
     }
 

Reply via email to