1
votes

I wrote a java client to connect to jms in websphere. I was able to connect and produce and consume message.

Problem I am facing is when I do Session.createQueue(), websphere jms is not creating a new queue.

Please could some one throw some light on this issue...

Thanks in advance...

2

2 Answers

2
votes

If you are working with WebSphere MQ as the messaging provider within WebSphere Application Server the queue will need to be created on the WebSphere MQ QueueManager first. This can be done either via the graphical WMQ Explorer or via the command line using the 'runmqsc' tool.

Information can be found for these via the WMQ InfoCentre - suggest doing a websearch for "WMQ Library" to get the latest link, currently though it is http://www-01.ibm.com/software/integration/wmq/library/index.html

Topics though don't need to be pre-created - though they can be if required. Various properties can be set different to the default.

If the Queue doesn't need to be permanent, for example as a temporary reply to then look into creating a temporary queue from the JMS Connection.

0
votes

createQueue doesn't create a new queue. It simply creates a javax.jms.Queue object from a vendor specific identifier. javax.jms.Queue objects are just references to existing queues. Typically, you retrieve javax.jms.Queue objects from JNDI; createQueue is only useful in scenarios where using JNDI is not possible or not desirable.

Note: there is one exception to this, namely JMS providers that support autocreation of queues (I think ActiveMQ has such a feature).