jhulst
jhulst

Reputation: 373

How to retrieve JMS Administered Objects from (GlassFish) server

My Glassfish server is up and running and I can run simple JMS client programs that send and retrieve messages to queues and topics that are configured in the Glassfish console manually.

I'm busy writing a simple JMSBrowser to study JMS and would like to find out how I can retrieve from a java client the names of the administered objects Server objects (ConnectionFactory, Queues & Topics).

For example I have ConnectionFactory with JNDI name jms/__defaultConnectionFactory, a Queue jms/GlassFishBookQueue and a topic jms/GlassFishBookTopic.

How can I retrieve these names, when I only know there resource types (javax.jms.ConnectionFactory, javax.jms.Queue and javax.jms.Topic)

In this example I have one of every kind, but each could of course be a list.

Spent a lot of time trying to figure it out, to no avail.

It should be possible as any JMSBrowser present this information, so for instance this screen shot:

https://sourceforge.net/projects/jmstoolbox/

Any hint would be appreciated.

Upvotes: 0

Views: 238

Answers (1)

titou10
titou10

Reputation: 2977

I'm the author of JMSToolBox
The JMS specs does not define a way to play with JMS artefacts defined in a server, ie create/delete/list..Queues/Topics/factories etc
Each Queue Manager has it's own proprietary way to expose those features. In JMSToolBox, I usually use JMX for that (with the help of proprietary MBeans..), but sometimes it is proprietary code to connect and list those objects. If you connect to the Queue manager server via JNDI, there is probably a way to list all the JMS artefacts from the JNDI tree, and based on some proprietary pattern, determine what "kind" of object they represent(Queue, ConnectionFactory etc..)

BTW, GlassFish embeds OpenMQ. Here is the way it is done in JMSToolBox

I hope this helps

Upvotes: 1

Related Questions