# Durable topic subscription

**URL:** <https://community.solace.com/t/durable-topic-subscription/157>\
**Category:** Solace Event Broker\
**Tags:** topics, durable-subscription\
**Created:** [January 15, 2020, 4:13pm UTC](https://community.solace.com/t/durable-topic-subscription/157 "2020-01-15T16:13:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rdesoju](https://avatars.discourse-cdn.com/v4/letter/r/a4c791/32.png) [@rdesoju](https://community.solace.com/u/rdesoju)\
**Post date:** [January 15, 2020, 4:13pm UTC](https://community.solace.com/t/durable-topic-subscription/157/1 "2020-01-15T16:13:56Z")

</div>

Hi,

In JMS world, we can have a topic and while connecting to the topic we can mention from the subscriber end to be a “durable” or “nondurable” subscriber.

However, on solace side, when I created a topic from CLI by default it provisions a “durable” topic it seems. How can I control subscription type from client side here, i.e. is there a provision to “add durable subscription” or “non-durable subscription” while creating a JCSMP client?

What kind of subscription be added when we use “session.addSubscription()”?

Is there a command to view active subscriptions from CLI?

Thanks,  
Raghu

---

<div class="post-metadata">

**Author:** ![Aaron](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/aaron/32/843_2.png) [@Aaron](https://community.solace.com/u/Aaron)\
**Post date:** [January 16, 2020, 1:26am UTC](https://community.solace.com/t/durable-topic-subscription/157/2 "2020-01-16T01:26:10Z")

</div>

Hey Raghu. In CLI or the PubSub+ Manager, you can only provision Durable Topic Endpoints… those are used when wanting to create a durable subscription in JMS. When the client binds to the endpoint (aka named subscription), it specifies the topic subscription it wants to inject and this gets added to the endpoint.

For non-persistent subscriptions, nothing needs to be configured on the broker. Solace is entirely dynamic in this way. When the API subscribes to a non-persistent topic, the subscription is simply added to the client. If you’re using CLI, do `show client * subscriptions` to see all clients and their non-persistent subscriptions. Or if in the PubSub+ Manager, simply double-click on a particular client and navigate to their subscriptions.

---

<div class="post-metadata">

**Author:** ![rdesoju](https://avatars.discourse-cdn.com/v4/letter/r/a4c791/32.png) [@rdesoju](https://community.solace.com/u/rdesoju)\
**Post date:** [January 16, 2020, 7:12pm UTC](https://community.solace.com/t/durable-topic-subscription/157/3 "2020-01-16T19:12:41Z")

</div>

Thank you @Aaron, I was able to figure out the way to add a durable subscription to a durable topic.

---

<div class="post-metadata">

**Author:** ![rdesoju](https://avatars.discourse-cdn.com/v4/letter/r/a4c791/32.png) [@rdesoju](https://community.solace.com/u/rdesoju)\
**Post date:** [January 16, 2020, 7:15pm UTC](https://community.solace.com/t/durable-topic-subscription/157/4 "2020-01-16T19:15:06Z")

</div>

`JCSMPFactory.onlyInstance().createDurableTopicEndpointEx();` solved my problem.

---

<div class="post-metadata">

**Author:** ![hong](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/hong/32/1613_2.png) [@hong](https://community.solace.com/u/hong)\
**Post date:** [January 27, 2020, 3:43pm UTC](https://community.solace.com/t/durable-topic-subscription/157/5 "2020-01-27T15:43:17Z")

</div>

@rdesoju Can you accept the answer? Thanks!
