[ 
https://issues.apache.org/jira/browse/CAMEL-14590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17040117#comment-17040117
 ] 

Connor McAuliffe commented on CAMEL-14590:
------------------------------------------

To expand a little on the pulsar side of this:

In the lifecycle of the subscription according to pulsar, "Subscriptions can be 
dropped by explicitly unsubscribing (in {{Consumer}} API) or through the 
REST/CLI"

[https://github.com/apache/pulsar/blob/master/faq.md#what-is-the-lifecycle-of-subscription]

In persistent subscriptions, unsubscribe calls delete on the subscription if 
the consumer is the last consumer
[https://github.com/apache/pulsar/blob/2e30c086b2461531c62164d09ea148928a0e3ae6/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentSubscription.java#L889]

So calling unsubscribe is basically like deleting the subscription, and not 
removing the consumer from the subscription

> Camel-Pulsar consumer calls unsubscribe on doStop/doSuspend, potentially 
> deleting subscription
> ----------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-14590
>                 URL: https://issues.apache.org/jira/browse/CAMEL-14590
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-pulsar
>            Reporter: Connor McAuliffe
>            Priority: Major
>
> In the PulsarUtils [stopConsumers 
> method|https://github.com/apache/camel/blob/master/components/camel-pulsar/src/main/java/org/apache/camel/component/pulsar/utils/PulsarUtils.java]
>  all the consumers call unsubscribe(). This causes the subscription to be 
> deleted if this call comes from the last consumer. I do not know if this is 
> intentional behavior but it seems to be dangerous (and has caused some issues 
> for us without realizing it). If this is intentional, can we make it 
> configurable to avoid doing this? Or if it is not intentional can we just 
> remove the call entirely?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to