Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

List Durable Subscriptions from JMS Topic

 
Srinivas Katta
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

We have a requirement to list all the durable subscriptions from the JMS topic and written below code to get the Topic name

Topic topic = null;
Properties p = new Properties( );
p.put(Context.PROVIDER_URL, "jnp://localhost:1099");
p.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
p.put(Context.URL_PKG_PREFIXES," org.jboss.namingrg.jnp.interfaces");

Context ctx = new InitialContext(p);

// Locate the Topic Connection Factory via JNDI
TopicConnectionFactory factory =
(TopicConnectionFactory) ctx.lookup(
"ConnectionFactory");

try
{
topic = (Topic) ctx.lookup("/topic/AB_MessageStore");
System.out.println("Topic Name:" + topic.getTopicName());
}
catch (NameNotFoundException exc)
{
exc.printStackTrace();
System.out.println("AB_MessageStore Topic not found");
}

Please let me know if anybody have any idea to list the subscriptions in that topic

Thanks
Srinivas

 
E Armitage
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First, you can probably view them on the console as explained here http://docs.oracle.com/cd/E14571_01/apirefs.1111/e13952/pagehelp/JMSjmssubscribersjmsdurablesubscriberruntimetitle.html

From code you might need to use JMX to query the JMSServerRuntimeMBean and JMSDurableSubscriberRuntimeMBean which are described here http://docs.oracle.com/cd/E23943_01/apirefs.1111/e13951/core/index.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic