Message properties

Use message properties to allow an application to select messages to process, or to retrieve information about a message without accessing MQMD or MQRFH2 headers. They also facilitate communication between IBM® MQ and JMS applications.

A message property is data associated with a message, consisting of a textual name and a value of a particular type. Message properties are used by message selectors to filter publications to topics or to selectively get messages from queues. Message properties can be used to include business data or state information without having to store it in the application data. Applications do not have to access data in the MQ Message Descriptor (MQMD) or MQRFH2 headers because fields in these data structures can be accessed as message properties using Message Queue Interface (MQI) function calls.

The use of message properties in IBM MQ mimics the use of properties in JMS. This means that you can set properties in a JMS application and retrieve them in a procedural IBM MQ application, or the other way round. To make a property available to a JMS application, assign it the prefix "usr"; it is then available (without the prefix) as a JMS message user property. For example, the IBM MQ property usr.myproperty (a character string) is accessible to a JMS application using the JMS call message.getStringProperty('myproperty'). Note that JMS applications are unable to access properties with the prefix "usr" if they contain two or more U+002E (".") characters. A property with no prefix and no U+002E (".") character is treated as if it had the prefix "usr". Conversely, a user property set in a JMS application can be accessed in an IBM MQ application by adding the "usr." prefix to the property name inquired on in an MQINQMP call.