Mapping JMS fields onto IBM MQ fields (outgoing messages)

These tables show how JMS header and property fields are mapped into MQMD and MQRFH2 fields at send() or publish() time.

Table 1 shows how the JMS header fields are mapped into MQMD/RFH2 fields at send() or publish() time. Table 2 shows how JMS properties are mapped into MQMD/RFH2 fields at send() or publish() time. Table 3 shows how JMS provider-specific properties are mapped to MQMD fields at send() or publish() time,

For fields marked Set by Message Object, the value transmitted is the value held in the JMS message immediately before the send() or publish() operation. The value in the JMS message is left unchanged by the operation.

For fields marked Set by Send Method, a value is assigned when the send() or publish() is performed (any value held in the JMS message is ignored). The value in the JMS message is updated to show the value used.

Fields marked as Receive-only are not transmitted and are left unchanged in the message by send() or publish().

JMS header field name MQMD field used for transmission Header Set by
JMSDestination   MQRFH2 Send Method
JMSDeliveryMode Persistence MQRFH2 Send Method
JMSExpiration Expiry MQRFH2 Send Method
JMSPriority Priority MQRFH2 Send Method
JMSMessageID MsgID   Send Method
JMSTimestamp PutDate/PutTime   Send Method
JMSCorrelationID CorrelId MQRFH2 Message Object
JMSReplyTo ReplyToQ/ReplyToQMgr MQRFH2 Message Object
JMSType   MQRFH2 Message Object
JMSRedelivered     Receive-only
Note:
  1. MQMD field CodedCharacterSetId is a numeric value that contains the equivalent of the Java character set string specified by the JMS_IBM_Character_Set property.

JMS property name MQMD field used for transmission Header Set by
JMSXUserID UserIdentifier   Send Method
JMSXAppID PutApplName   Send Method
JMSXDeliveryCount     Receive-only
JMSXGroupID GroupId MQRFH2 Message Object
JMSXGroupSeq MsgSeqNumber MQRFH2 Message Object
Note:

These properties are defined as read-only by the JMS specification, and are set (in some cases optionally) by the JMS provider.

In IBM MQ classes for JMS two of these properties can be overridden by the application. To do this, ensure that the destination has been configured appropriately by setting the following properties:
  1. Set the property WMQConstants.WMQ_MQMD_MESSAGE_CONTEXT to WMQConstants.WMQ_MDCTX_SET_ALL_CONTEXT.
  2. Set the property WMQConstants.WMQ_MQMD_WRITE_ENABLED to true.

The following properties can be overridden by the application:

    JMSXAppID
    This property can be overridden by setting the property WMQConstants.JMS_IBM_MQMD_PUTAPPLNAME on the message - the value should be a Java String.

    JMSXGroupID
    This property can be overridden by setting the property WMQConstants.JMS_IBM_MQMD_GROUPID on the message - the value should be a byte array.

JMS provider-specific property name MQMD field used for transmission Header Set by
JMS_IBM_Report_Exception Report   Message Object
JMS_IBM_Report_Expiration Report   Message Object
JMS_IBM_Report_COA/COD Report   Message Object
JMS_IBM_Report_NAN/PAN Report   Message Object
JMS_IBM_Report_Pass_Msg_ID Report   Message Object
JMS_IBM_Report_Pass_Correl_ID Report   Message Object
JMS_IBM_Report_Discard_Msg Report   Message Object
JMS_IBM_MsgType MsgType   Message Object
JMS_IBM_Feedback Feedback   Message Object
JMS_IBM_Format Format   Message Object
JMS_IBM_PutApplType PutApplType   Send Method
JMS_IBM_Encoding Encoding   Message Object
JMS_IBM_Character_Set CodedCharacterSetId   Message Object
JMS_IBM_PutDate PutDate   Send Method
JMS_IBM_PutTime PutTime   Send Method
JMS_IBM_Last_Msg_In_Group MsgFlags   Message Object

Parent topic: Mapping JMS messages onto IBM MQ messages