Hi, I'm connecting to an IBM Websphere MQ and currently reading one message at a time using the method receive() from the object:
javax.jms.Message;
Is there a way to retrieve multiple messages from the queue in one go?
Many thanks, G.
Hi, I'm connecting to an IBM Websphere MQ and currently reading one message at a time using the method receive() from the object:
javax.jms.Message;
Is there a way to retrieve multiple messages from the queue in one go?
Many thanks, G.
Depends on whether you make a distinction between "read" and "retrieve".
From a JMS perspective, no. The API will return one message per method call.
From the WMQ perspective, yes - provided the client and queue manager are both at v7 and the messages are non-persistent or being browsed. In this case you can enable read-ahead in the managed object definition or dynamically at run time. The queue manager will stream several messages off of the queue and deliver them to the application before the first one is acknowledged. For more information on this, see Using read ahead with WebSphere MQ classes for JMS.