Mapping the message header fields and properties to and from IBM MQ format
When service integration converts a message to IBM MQ format, it sets fields in the MQMD and the MQRFH2 based on the service integration message header fields and properties; these include JMS message header fields and properties applicable to the message. When service integration converts a message from IBM MQ format, it sets the service integration message header fields and properties from the MQMD and the MQRFH2 in the IBM MQ message.
Exchanging messages between JMS programs through service integration and IBM MQ
Usually, you do not have to be aware of conversion between message formats to exchange JMS messages between service integration and IBM MQ, because service integration performs the appropriate conversion automatically, including character and numeric encoding. However, you might have to learn about message conversion if your JMS applications do not behave as expected, or if your service integration configuration includes JMS programs or mediations that process messages to or from non-JMS IBM MQ programs.
If your service integration applications exchange MapMessage objects with IBM MQ applications, you might have to specify a non-default map message encoding format.
IBM MQ message properties: the MQMD and the MQRFH2
Similarly, service integration
might receive messages from IBM MQ applications
that generate messages with no MQRFH2. When service integration receives
a message with no MQRFH2, it creates a best guess
service integration
header, by getting as much information as it can from the MQMD, and
using default values for the other fields.
For detailed information about the contents of the message descriptor and the message headers, see the IBM MQ Application programming reference. For details of IBM MQ JMS support, including details of how IBM MQ stores JMS message properties and header fields in the MQMD and the MQRFH2, see Using WebSphere MQ classes for JMS.
IBM MQ message properties: JMS header fields
The following table shows how service integration maps JMS header fields to and from MQMD and MQRFH2 fields when converting messages to and from IBM MQ format.
The table shows the MQRFH2 field as folder.field, where folder is the name of the MQRFH2 folder that contains the field, and field is the name of the field within the MQRFH2 folder.
For several JMS header fields, there is both an MQMD field and an MQRFH2 field. When service integration is converting messages to IBM MQ format, it sets both the MQMD and the MQRFH2 fields. When service integration is converting messages from IBM MQ format, it sets the JMS header field from the MQRFH2 field if it is available, otherwise from the MQMD field.
| JMS header field | MQMD field | MQRFH2 field | Notes |
|---|---|---|---|
| JMSCorrelationID | CorrelId | jms.Cid | See Note 1. |
| JMSDeliveryMode | Persistence | jms.Dlv | See Note 15. |
| JMSDestination | jms.Dst | See Note 16. | |
| JMSExpiration | Expiry | jms.Exp | |
| JMSMessageID | MsgId | ||
| JMSPriority | Priority | See Note 2. | |
| JMSRedelivered | BackoutCount | See Note 3. | |
| JMSReplyTo | ReplyToQ and ReplyToQMgr | jms.Rto | See Note 16. |
| JMSTimestamp | PutDate and PutTime | jms.Tms | |
| JMSType | mcd.Type |
byte[] value, a string value containing hexadecimal
characters and prefixed with ID:, or an arbitrary string value not beginning
ID:. The first two of these represent a standard IBM MQ Correlation ID and map directly to or from the MQMD CorrelId field (truncated or padded with zeros as applicable); they do not use the MQRFH2 jms.Cid field. The third (arbitrary string) uses the MQRFH2 jms.Cid field; the first 24 bytes of the string, in UTF-8 format, are written into the MQMD CorrelID.
IBM MQ message properties: JMS defined properties
The following table shows how service integration maps JMS defined properties to and from MQMD and MQRFH2 fields when converting messages to and from IBM MQ format.
The table shows the MQRFH2 field as folder.field, where folder is the name of the MQRFH2 folder that contains the field, and field is the name of the field within the MQRFH2 folder.
For several JMS-defined properties, there is both an MQMD field and an MQRFH2 field. When service integration is converting messages to IBM MQ format, it sets both the MQMD and the MQRFH2 fields. When service integration is converting messages from IBM MQ format, it sets the JMS defined property from the MQRFH2 field if it is available, otherwise from the MQMD field.
| JMS defined property | MQMD field | MQRFH2 field | Notes |
|---|---|---|---|
| JMSXAppID | PutApplName | ||
| JMSXDeliveryCount | BackoutCount | ||
| JMSXGroupID | GroupId | jms.Gid | See Notes 4 and 5. |
| JMSXGroupSeq | MsgSeqNumber | jms.Seq | |
| JMSXUserID | UserIdentifier |
ID:or an arbitrary string value not beginning
ID:. The first of these represents a standard IBM MQ GroupId and maps directly to or from the MQMD GroupId field (truncated or padded with zeros as applicable). The second (arbitrary string) uses the MQRFH2 jms.Gid field; the first 24 bytes of the string, in UTF-8 format, are written into the MQMD GroupId.
IBM MQ message properties: JMS provider-specific properties
The following table shows how service integration maps JMS provider-specific properties to and from MQMD and MQRFH2 fields when converting messages to and from WebSphere MQ format. Typically you use these properties to satisfy special requirements in the receiving application, so you should consult the developer or administrator of the receiving application for details of the required property values.
| JMS provider-specific property | MQMD field | MQRFH2 field | Notes |
|---|---|---|---|
| JMS_IBM_ArmCorrelator | mqext.Arm | See Note 6. | |
| JMS_IBM_Character_Set | CodedCharacterSetId | CodedCharacterSetId | See Note 7. |
| JMS_IBM_Encoding | Encoding | Encoding | See Note 7. |
| JMS_IBM_Feedback | Feedback | ||
| JMS_IBM_Format | Format | Format | See Note 7. |
| JMS_IBM_Last_Msg_In_Group | MQMF_LAST_MSG_IN_GROUP | See Note 8. | |
| JMS_IBM_MQMD_CorrelId | CorrelId | See Notes 9 and 10. | |
| JMS_IBM_MQMD_MsgId | MsgId | See Notes 9 and 11. | |
| JMS_IBM_MQMD_Persistence | Persistence | See Notes 9, 12, and 15. | |
| JMS_IBM_MQMD_ReplyToQ | ReplyToQ | See Notes 9, 13, and 16. | |
| JMS_IBM_MQMD_ReplyToQMgr | ReplyToQMgr | See Notes 9, 13, and 16. | |
| JMS_IBM_MsgType | MsgType | ||
| JMS_IBM_PutDate | PutDate | ||
| JMS_IBM_PutTime | PutTime | ||
| JMS_IBM_Report_* | Report | See Note 14. | |
| JMS_IBM_RMCorrelator | mqext.Wrm | ||
| JMS_TOG_ARM_Correlator | mqext.Arm | See Note 6. |
setObjectProperty() or setNonNullProperty()). Service integration sets each of these properties from the corresponding MQMD field when it converts a message from IBM MQ format.
byte[])
if explicitly set of the JMS_IBM_MQMD_CorrelId property,
regardless of the value (if any) of the JMSCorrelationID property.
Setting the JMS_IBM_MQMD_CorrelId property does
not affect the value of the MQRFH2 jms.Cid field. When
service integration converts messages from IBM MQ format, service integration
sets the JMS_IBM_MQMD_CorrelId property to the
value (byte[]) of the MQMD CorrelId field,
regardless of the value (if any) of the MQRFH2 jms.Cid field.
When service integration converts
messages from IBM MQ format,
service integration sets the JMS_IBM_MQMD_MsgId property
to the value (byte[]) of the MQMD MsgId field.
When service integration converts messages from IBM MQ format, service integration sets the JMS_IBM_MQMD_Persistence property to the value (integer) of the MQMD Persistence field, regardless of the value (if any) of the MQRFH2 jms.Dlv field.
When service integration converts messages from IBM MQ format, service integration sets the JMS_IBM_MQMD_ReplyToQ and JMS_IBM_MQMD_ReplyToQMgr property to the values (string) of the MQMD ReplyToQ and ReplyToQMgr fields, regardless of the value (if any) of the MQRFH2 jms.Rto field.