my dog learned polymorphism*
The moose likes EJB and other Java EE Technologies and the fly likes List Durable Subscriptions from JMS Topic Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "List Durable Subscriptions from JMS Topic" Watch "List Durable Subscriptions from JMS Topic" New topic

List Durable Subscriptions from JMS Topic

Srinivas Katta
Ranch Hand

Joined: Feb 01, 2007
Posts: 76

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.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(

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

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


E Armitage

Joined: Mar 17, 2012
Posts: 892
First, you can probably view them on the console as explained here

From code you might need to use JMX to query the JMSServerRuntimeMBean and JMSDurableSubscriberRuntimeMBean which are described here
It is sorta covered in the JavaRanch Style Guide.
subject: List Durable Subscriptions from JMS Topic
Similar Threads
does JBoss ship with a predefined TopicConnectionFactory?
JMS and client application
Failed to initialize the ORB using websphere.
Question on MessageDriven Beans
Durable Subscription