0

Whenever i start my subscriber, it is not appearing on my activeMQ under "Active Durable Topic Subscribers" section. Which means it is not a durable topic subscriber yet. How can i make it durable subscriber?

JmsComponent jmsComponent = JmsComponent
        .jmsComponentTransacted(connectionFactory, jmsTransactionManager);
// TODO
jmsComponent.setClientId(subscriptionClientId);
jmsComponent.setDurableSubscriptionName(subscriptionName);
jmsComponent.setSubscriptionDurable(true); // This is enabled by default
//jmsComponent.setMaxConcurrentConsumers(maxConcurrentConsumers);
jmsComponent.setAcknowledgementMode(Session.AUTO_ACKNOWLEDGE);

return jmsComponent;

P.S: It works fine for Non-durable subscribers. I added the below code in an attempt to make it durable. Am i missing something ? Do i need to add anything else?

jmsComponent.setClientId(subscriptionClientId);
jmsComponent.setDurableSubscriptionName(subscriptionName);
jmsComponent.setSubscriptionDurable(true); // This is enabled by default
ImranRazaKhan
  • 1,955
  • 5
  • 33
  • 74
user3007165
  • 459
  • 1
  • 5
  • 14

1 Answers1

2

I got it working by passing the subscription details as query string param as below;

myapp.jms.topic.inbound1=jms:topic:myFirstTopic?clientId=ABC&durableSubscriptionName=ABC

myapp.jms.topic.inbound2=jms:topic:mysecondTopic?clientId=XYZ&durableSubscriptionName=XYZ

user3007165
  • 459
  • 1
  • 5
  • 14
  • Shouldn't the [clientId](https://camel.apache.org/components/latest/jms-component.html) be unique per JMS Connection? Does it mean we should setClientId on our jmsComponent once only and just use different unique durableSubscriptionName in our camel uri passed as query string param? – Muhammad Arslan Akhtar Sep 24 '19 at 06:38