Handling message properties in WebSphere MQ classes for Java
Function calls to process message handles have no equivalent in WebSphere® 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 WebSphere 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 WebSphere MQ function calls MQCRTMH, MQDLTMH, MQMHBUF, and MQBUFMH
To set message handle properties in the procedural interface, you
use the call MQSETMP. In WebSphere 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
To return the value of message handle properties in the procedural
interface, you use the call MQINQMP. In
WebSphere 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
To delete the value of message handle properties in the procedural interface, you use the call MQDLTMP. In WebSphere MQ classes for Java, use the deleteProperty method of the MQMessage class.