How to list available destinations/topics in a SonicMQ environment
I am trying to write a test utility to list out the various items within the SonicMQ environments I connect to. I have been able to list out a number of items, including brokers, containers, and queues, but topics continue to elude me. I have searched through the API doc and played around a bit in code to no avail.
Is there a way to list out topics in Soni开发者_Python百科cMQ? Is there perhaps a more generic means of listing all destinations (queues and topics)? Is there something in JMS that I missed to get this information?
In SonicMQ topics are no administered Objects -> you can create a Listener or a Sender to any topic name you want. Therefor you have to use the Runtime API for the Management Environment. There is no way to do this via the Configuration API, neither is there any way in native JMS.
In using the Runtime API you have to get an IBrokerProxy object. I assume you already have an IBrokerProxy Object. On this Object there are a set of methods to get Global and Durable Subscriptions. As far as i know, there is no way to get other subscription types.
To see the durable subscriptions you have to get the users with durable subscriptions first. This is done with the getUsersWithDurableSubscriptions(String prefix) method, which will give you an ArrayList with all the users having a Durable Subscriptions. For each User you have to call the getDurableSubscriptions(String user) method, which will then return you a list of durable subscriptions of this user.
To get all remote/global Subscriptions you can use the method getRemoteSubscriptionSummary().
精彩评论