views:

290

answers:

1

Hi, I have a general question about the JMS createQueue method. In WebSphere MQ is this method used as an alternative to the JNDI lookup? I was thinking that I could dynamically create a queue. Is this possible? Thank you.

+1  A: 

Assuming you mean QueueSession.createQueue, this is a very misleading method, and doesn't do what you might think:

Creates a queue identity given a Queue name.

This facility is provided for the rare cases where clients need to dynamically manipulate queue identity. It allows the creation of a queue identity with a provider-specific name. Clients that depend on this ability are not portable.

Note that this method is not for creating the physical queue. The physical creation of queues is an administrative task and is not to be initiated by the JMS API. The one exception is the creation of temporary queues, which is accomplished with the createTemporaryQueue method.

The JMS API does not provide a way of dynamically creating queues (unless you mean temporary queues, which are a very different beast used by request-response messaging). If you want to create queues are runtime, that's going to be proprietary to WebSphere.

skaffman
Are you aware if WebSphere allows dynamic creation of Queues?
I think what I am looking for is a Model Queue object? http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.amqzag.doc/fa10420_.htm
I'm not familiar with WebSphere; you're on your own there, sorry.
skaffman
To note: I found my answer and other answers in this document:http://publibfp.boulder.ibm.com/epubs/pdf/csqzaw12.pdf