Properties of an XMS message

XMS supports three kinds of message property: JMS defined properties, IBM defined properties, and application-defined properties.

An XMS application can exchange messages with a WebSphere JMS application because XMS supports the following predefined properties of a Message object:

  • The same JMS-defined properties that WebSphere JMS supports. The names of these properties begin with the prefix JMSX.
  • The same IBM-defined properties that WebSphere JMS supports. The names of these properties begin with the prefix JMS_IBM_.

Each predefined property has two names:

  • A JMS name, for a JMS-defined property, or a WebSphere JMS name, for an IBM-defined property.

    This is the name by which the property is known in JMS or WebSphere JMS, and it is also the name that is transmitted with a message that has this property. An XMS application uses this name to identify the property in a message selector expression.

  • An XMS name to identify the property in all situations except in a message selector expression. Each XMS name is defined as a named constant in IBM.XMS.XMSC class. The value of the named constant is the corresponding JMS or WebSphere JMS name.

In addition to the predefined properties, an XMS application can create and use its own set of message properties. These properties are called application defined properties.

After an application creates a message, the properties of the message are readable and writable. The properties remain readable and writable after the application sends the message. When an application receives a message, the properties of the message are read-only. If an application calls the Clear Properties method of the Message class when the properties of a message are read-only, the properties become readable and writable. The method also clears the properties.

The received message, when forwarded after clearing up the message properties, will behave in a manner consistent with the behavior of forwarding a standard WMQ XMS for .NET BytesMessage with message properties cleared up.

This is, however, not recommended since the following properties will be lost:

  • JMS_IBM_Encoding property value, implying that the message data cannot be decoded meaningfully.
  • JMS_IBM_Format property value, implying that the header chaining between the (MQMD or the new MQRFH2) message header and existing headers would be broken.

To determine the values of all the properties of a message, an application can call the Get Properties method of the Message class. The method creates an iterator that encapsulates a list of Property objects, where each Property object represents a property of the message. The application can then use the methods of the Iterator class to retrieve each Property object in turn, and it can use the methods of the Property class to retrieve the name, data type, and value of each property.

  • JMS-defined properties of a message
    Several JMS-defined properties of a message are supported by both XMS and WebSphere JMS.
  • IBM-defined properties of a message
    Several IBM-defined properties of a message are supported by XMS and WebSphere JMS.
  • Application-defined properties of a message
    An XMS application can create and use its own set of message properties. When an application sends a message, these properties are also transmitted with the message. A receiving application, using message selectors, can then select which messages it wants to receive based on the values of these properties.

Parent topic: XMS messages