How service integration converts messages to and from IBM MQ format
Messages are converted between IBM MQ format and service integration format as they flow between the two systems.
Exchanging messages between JMS programs through service integration and IBM MQ
Usually, we 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, we 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 our service integration applications exchange MapMessage objects with IBM MQ applications, we might have to specify a non-default map message encoding format.
When service integration converts messages to and from IBM MQ format
Service integration converts a service integration message into an IBM MQ message in the following circumstances:
- When service integration sends a message to IBM MQ using an IBM MQ link.
- When a service integration mediation places the message on a queue point that is an IBM MQ queue.
- When a service integration application sends the message to a destination where the mediation point (if any) or the queue point (if there is no mediation) is an IBM MQ queue.
Service integration converts an IBM MQ message into a service integration message in the following circumstances:
- When IBM MQ sends the message to a service integration bus using an IBM MQ link.
- When a service integration mediation receives the message from a mediation point that is an IBM MQ queue.
- When a service integration application receives the message from a destination where the queue point is an IBM MQ queue.
When we use the IBM MQ messaging provider, there is no conversion between IBM MQ format and service integration format.
Overview of message conversion
When service integration converts a message to IBM MQ format, it usually constructs an IBM MQ message descriptor (MQMD), a rules and formatting header 2 (MQRFH2), and a message payload:
- Message descriptor (MQMD): Service integration sets fields in the MQMD based on the service integration message header fields and properties; these include JMS message header fields and properties applicable to the message. Service integration always constructs an MQMD.
- Rules and formatting header 2 (MQRFH2): Service integration sets fields in the MQRFH2 based on the service integration message header fields and properties. Some IBM MQ applications cannot process messages that contain an MQRFH2. To simplify interoperation, we can configure service integration to omit the MQRFH2 from messages for applications that cannot process the MQRFH2. However, be aware that when service integration omits the MQRFH2, it discards the corresponding service integration header fields and properties.
- Message payload: Service integration uses the body of the service integration message (if any) as the payload of the IBM MQ 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 (if present) the MQRFH2 in the IBM MQ message.
- It sets the service integration message body to the contents (if any) of the IBM MQ message that immediately follow the MQRFH2.
- If the message contains other headers, instead of, or as well as, the MQRFH2 header, those headers are treated as part of the JMS message body and the JMS message becomes a bytes message.
Figure 1. Message conversion to and from IBM MQ format
For reference information about the mappings for specific message header fields and properties between a service integration bus and IBM MQ, see the topics listed in the related reference. To help you program applications that interoperate with IBM MQ, these topics describe how the message formats are mapped between service integration messages and IBM MQ messages.
Mapping the message body to and from IBM MQ format Mapping the message header fields and properties to and from IBM MQ format Mapping MQMD Report fields to JMS provider-specific properties Mapping additional MQRFH2 header fields in service integration Mapping the JMS delivery option and message reliability to and from the IBM MQ persistence value Mapping destinations to and from IBM MQ queues, topics, and destinations How to process IBM MQ message headers