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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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
Author

List Durable Subscriptions from JMS Topic

Srinivas Katta
Ranch Hand

Joined: Feb 01, 2007
Posts: 76
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

Joined: Mar 17, 2012
Posts: 892
    
    9
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: List Durable Subscriptions from JMS Topic