...
- Open Admin Studio
- Login through FMQ-JMX and traverse to Fiorano > mq > pubsub > PubSubManager > TopicSubSystem > config.
- Modify 'the UseTopicIDBaseForSharedSubs' parameter parameter
- Save configuration and restart server
Anchor | ||||
---|---|---|---|---|
|
If this 'boolean' parameter is set to true (default value - false), the secondary client identifier will have the topic's name within it. In such a case, rather than using the normal way to unsubscribe a durable subscription from client application using only the subscription name, it must be done in the following way -
Java
TopicConnection topicConnection = topicConnectionFactory.createTopicConnection();
TopicSession topicSession = topicConnection.createTopicSession(false, 1);
MessageConsumer tsub = topicSession.createSharedDurableConsumer(topic, "Sample_Durable_Subscriber");
..
topicSession.unsubscribe(topicName, "Sample_Durable_Subscriber"); //changed
CPP
m_tc = m_tcf->createTopicConnection(m_usrName, m_usrPasswd);
m_ts = m_tc->createTopicSession(FALSE, AUTO_ACKNOWLEDGE);
m_subscriber = m_ts->createSharedDurableConsumer(m_topic,
"Sample_Durable_Subscriber");
..
m_ts->unsubscribe(topicName, "Sample_Durable_Subscriber"); //changed