users@glassfish.java.net

Re: Resources created w/MQ Admin Console not seen in Glassfish Admin console

From: <glassfish_at_javadesktop.org>
Date: Tue, 23 Jun 2009 10:38:40 PDT

You're right, there is a disconnect here between the standalone MQ world and the Glassfish world, and I completely agree it is confusing and the documentation should explain it better.

The thing to understand is that when you use standalone MQ (including the MQ admin console), the connections and connection factories you work with are simple JMS objects, and when you use Glassfish (including the Glassfish admin console) the connections and connection factories you work with are actually provided by the JMS resource adapter and have some significant differences in behaviour and capability.

When you look up a Connection object within Glassfish you get a com.sun.messaging.jms.ra.ConnectionAdapter object, which you can think of as wrapping the underlying MQ connection object.

When you look up a ConnectionFactory object within Glassfish you get a com.sun.messaging.jms.ra.ManagedConnectionFactory, which you can think of as wrapping the underlying MQ connection factory object.

The reason why the resource adapter wraps the underlying implementation in this way is to provide extra behaviour required by application servers such as connection pooling.

As you have discovered, one difference between a com.sun.messaging.jms.ra.ConnectionAdapter and a simple MQ connection is that you can't set ClientID on a ConnectionAdapter . If you try you get the message "MQRA:CA:Unsupported-setClientID()".

Instead you need to set ClientID on its connection [i]factory [/i](i.e. on the com.sun.messaging.jms.ra.ManagedConnectionFactory).

The MQ admin guide lists the properties you can set on the com.sun.messaging.jms.ra.ManagedConnectionFactory:
http://docs.sun.com/app/docs/doc/820-6740/aeoop?a=view
as you can see this includes clientID.

You can set these properties using the Glassfish admin console or using the Glassfish asadmin create-jms-resource command, which is its command-line equivalent.

asadmin create-jms-resource is documented here:
http://docs.sun.com/app/docs/doc/820-4332/create-jms-resource-1?a=view
(scroll down to the mention of clientID)

Does this help?

Nigel
[Message sent by forum member 'nigeldeakin' (nigeldeakin)]

http://forums.java.net/jive/thread.jspa?messageID=352543