put

 

public void put(MQMessage message, MQPutMessageOptions putMessageOptions) 
              throws MQException;

Puts a message onto the queue.

Modifications to the MQMessage object after the put has completed do not affect the actual message on the queue.

If you use the same MQMessage object to make further calls, then performing a put updates MQMessage.messageId and MQMessage.correlationId.

Note also that calling put does not clear the message data. For example:

 msg.writeString("a");
 q.put(msg,pmo);
 msg.writeString("b");
 q.put(msg,pmo); 
 
results in "ab" being put by the second call.

Parameters

  • message - an object which contains the message descriptor data and the message data to be sent. On completion the values are set to those of the message which was put on the queue.

  • putMessageOptions - Options controlling the action of the put. See MQPutMessageOptions.options for details.

Exceptions

  • MQException - if the put fails.


uj14790_