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 14:59:50 PDT

Nigel,

Thanks for the helpful information.

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

OK I have a few observations with this:

  * Setting the clientID in this fashion is non-portable as I must specifically do so with the com.sun.messaging.jms.ra.ManagedConnectionFactory class because the javax.resource.spi.ManagedConnectionFactory interface does not have a setClient() method. Outside of GF JMSRA setting the clientId can be done against the TopicConnection interface and is therefor portable.

  * All connections from the same factory will have the same clientID, where as before I could set this on a per connection basis vs. per factory basis. Is there a particular reason for the design choice of shifting setting clientId to the factory?

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

Currently the code I am porting is patterned such that when a class wishes to act as a durable subscriber it extends a 'TopicMessageListener' and passes in a destination and subscriber name which previously was used to set the unique clientID on the connection. This class would also have access to the ManagedConnectionFactory (after I make a few changes) . Based on your information it sounds like having it set the clientID on the ManagedConnectionFactory in the same fashion it did on the connection is the way I need to go.

> Does this help?

Yes, quite a bit. Thanks again.

-NBW
[Message sent by forum member 'emailnbw' (emailnbw)]

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