Handling message properties in IBM MQ classes for Java

Function calls to process message handles have no equivalent in IBM® MQ classes for Java. To set, return, or delete message handle properties, use methods of the MQMessage class.

For general information about message properties, see Property names.

In IBM MQ classes for Java access to messages is through the MQMessage class. Message handles are therefore not provided in the Java environment and there is no equivalent to the IBM MQ function calls MQCRTMH, MQDLTMH, MQMHBUF, and MQBUFMH

To set message handle properties in the procedural interface, you use the call MQSETMP. In IBM MQ classes for Java, use the appropriate method of the MQMessage class:
  • setBooleanProperty
  • setByteProperty
  • setBytesProperty
  • setShortProperty
  • setIntProperty
  • setInt2Property
  • setInt4Property
  • setInt8Property
  • setLongProperty
  • setFloatProperty
  • setDoubleProperty
  • setStringProperty
  • setObjectProperty
These are sometimes referred to collectively as the set*property methods.
To return the value of message handle properties in the procedural interface, you use the call MQINQMP. In IBM MQ classes for Java, use the appropriate method of the MQMessage class:
  • getBooleanProperty
  • getByteProperty
  • getBytesProperty
  • getShortProperty
  • getIntProperty
  • getInt2Property
  • getInt4Property
  • getInt8Property
  • getLongProperty
  • getFloatProperty
  • getDoubleProperty
  • getStringProperty
  • getObjectProperty
These are sometimes referred to collectively as the get*property methods.

To delete the value of message handle properties in the procedural interface, you use the call MQDLTMP. In IBM MQ classes for Java, use the deleteProperty method of the MQMessage class.