JMS message object properties

Message object properties prefixed JMS_IBM_MQMD allow you to set or read the corresponding MQMD field.


Send messages

All MQMD fields except StrucId and Version are represented. These properties refer only to the MQMD fields; where a property occurs both in the MQMD and in the MQRFH2 header, the version in the MQRFH2 is not set or extracted.

Any of these properties can be set, except JMS_IBM_MQMD_BackoutCount. Any value set for JMS_IBM_MQMD_BackoutCount is ignored.

If a property has a maximum length and you supply a value that is too long, the value is truncated.

For certain properties, we must also set the WMQ_MQMD_MESSAGE_CONTEXT property on the Destination object. The application must be running with appropriate context authority for this property to take effect. If we do not set WMQ_MQMD_MESSAGE_CONTEXT to an appropriate value, the property value is ignored. If you set WMQ_MQMD_MESSAGE_CONTEXT to an appropriate value but we do not have sufficient context authority for the queue manager, a JMSException is issued. Properties requiring specific values of WMQ_MQMD_MESSAGE_CONTEXT are as follows.

The following properties require WMQ_MQMD_MESSAGE_CONTEXT to be set to WMQ_MDCTX_SET_IDENTITY_CONTEXT or WMQ_MDCTX_SET_ALL_CONTEXT:

  • JMS_IBM_MQMD_UserIdentifier
  • JMS_IBM_MQMD_AccountingToken
  • JMS_IBM_MQMD_ApplIdentityData

The following properties require WMQ_MQMD_MESSAGE_CONTEXT to be set to WMQ_MDCTX_SET_ALL_CONTEXT :

  • JMS_IBM_MQMD_PutApplType
  • JMS_IBM_MQMD_PutApplName
  • JMS_IBM_MQMD_PutDate
  • JMS_IBM_MQMD_PutTime
  • JMS_IBM_MQMD_ApplOriginData


Receive messages

All these properties are available on a received message if WMQ_MQMD_READ_ENABLED property is set to true, irrespective of the actual properties the producing application has set. An application cannot modify the properties of a received message unless all properties are cleared first, according to the JMS specification. The received message can be forwarded without modifying the properties. Attention: If the application receives a message from a destination with WMQ_MQMD_READ_ENABLED property set to true, and forwards it to a destination with WMQ_MQMD_WRITE_ENABLED set to true, this results in all the MQMD field values of the received message being copied into the forwarded message.


Table of properties

This table lists the properties of the Message object representing the MQMD fields. See the links for full descriptions of the fields and their allowable values.

Property Description Java Type Link to full description
JMS_IBM_MQMD_Report Options for report messages Integer Report
JMS_IBM_MQMD_MsgType Message type Integer MsgType
JMS_IBM_MQMD_Expiry Message lifetime Integer Expiry
JMS_IBM_MQMD_Feedback Feedback or reason code Integer Feedback
JMS_IBM_MQMD_Encoding Numeric encoding of message data Integer Encoding
JMS_IBM_MQMD_CodedCharSetId Character set identifier of message data Integer CodedCharSetId
JMS_IBM_MQMD_Format Format name of message data String Format
JMS_IBM_MQMD_Priority 1 Message priority Integer Priority
JMS_IBM_MQMD_Persistence Message persistence Integer Persistence
JMS_IBM_MQMD_MsgId 2 Message identifier Object (byte[]) 4 MsgId
JMS_IBM_MQMD_CorrelId 3 Correlation identifier Object (byte[]) 4 CorrelId
JMS_IBM_MQMD_BackoutCount Backout counter Integer BackoutCount
JMS_IBM_MQMD_ReplyToQ Name of reply queue String ReplyToQ
JMS_IBM_MQMD_ReplyToQMgr Name of reply queue manager String ReplyToQMgr
JMS_IBM_MQMD_UserIdentifier User identifier String UserIdentifier
JMS_IBM_MQMD_AccountingToken Accounting token Object (byte[]) 4 AccountingToken
JMS_IBM_MQMD_ApplIdentityData Application data relating to identity String ApplIdentityData
JMS_IBM_MQMD_PutApplType Type of application that put the message Integer PutApplType
JMS_IBM_MQMD_PutApplName Name of application that put the message String PutApplName
JMS_IBM_MQMD_PutDate Date when message was put String PutDate
JMS_IBM_MQMD_PutTime Time when message was put String PutTime
JMS_IBM_MQMD_ApplOriginData Application data relating to origin String ApplOriginData
JMS_IBM_MQMD_GroupId Group identifier Object (byte[]) 4 GroupId
JMS_IBM_MQMD_MsgSeqNumber Sequence number of logical message within group Integer MsgSeqNumber
JMS_IBM_MQMD_Offset Offset of data in physical message from start of logical message Integer Offset
JMS_IBM_MQMD_MsgFlags Message flags Integer MsgFlags
JMS_IBM_MQMD_OriginalLength Length of original message Integer OriginalLength
  1. Attention: If you assign a value to JMS_IBM_MQMD_Priority that is not within the range 0-9, this violates the JMS specification.
  2. Attention: The JMS specification states that the message ID must be set by the JMS provider and that it must either be unique or null. If you assign a value to JMS_IBM_MQMD_MsgId, this value is copied to the JMSMessageID. Thus it is not set by the JMS provider and might not be unique: this violates the JMS specification.
  3. Attention: If you assign a value to JMS_IBM_MQMD_CorrelId that starts with the string 'ID:', this violates the JMS specification.
  4. Attention: The use of byte array properties on a message violates the JMS specification.

Parent topic: Reading and writing the message descriptor from an IBM MQ classes for JMS application