setJMSMessageID

 

public void setJMSMessageID(String id) throws JMSException;

Sets the message ID.

Any value set using this method is ignored when the message is sent, but this method can be used to change the value in a received message.

Because a message ID set by this method is ignored when a message is sent, an application cannot specify the message ID of an outgoing message. As a consequence, an application cannot receive a message and then forward the same message, or send a different message, with the same message ID as that of the message it has received. The behavior of WebSphere MQ classes for Java differs in this respect. An application using WebSphere MQ classes for Java can specify the message ID of an outgoing message.

Parameters

  • id - the ID of the message.

Exceptions

  • JMSException - if an internal error occurs.


uj26770_