get

 

public void get(MQMessage message, MQGetMessageOptions getMessageOptions) 
              throws MQException;

Retrieves a message from the queue, regardless of the size of the message. For large messages, this might require two calls to WebSphere MQ, One to establish the required buffer size and one to get the message data itself.

If the call fails, the MQMessage object is unchanged. If it succeeds, the message descriptor fields and message data portions of the MQMessage are completely overwritten by the fields and data from the incoming message.

Note that if you perform a get with wait, all other threads using the same MQQueueManager are blocked until the call completes. If we need multiple threads to access WebSphere MQ simultaneously, then each thread must create its own MQQueueManager object.

Parameters

  • message - an input/output parameter which contains the message descriptor information and the returned message data. On input some of the fields are used as input parameters, in particular messageId and correlationId. It is important to ensure that these are set as required.

  • getMessageOptions - options which control the action of the get. See MQGetMessageOptions.options for details.

Exceptions

  • MQException - if the get fails.


uj14600_