Mapping IBM MQ fields onto AMQP fields (outgoing messages)
When an IBM MQ message is published and IBM MQ sends it to an AMQP consumer, it will propagate some of the attributes of the IBM MQ message into equivalent AMQP message attributes.
header
A header is only included if one of the five fields in the header contains a non-default value. Only the fields with a non-default value are included in the header. The five header fields are initially derived from the equivalent mq_amqp.Hdr property, if it is set, and then modified as shown in the following table:
Field | Default value | Value |
---|---|---|
durable | false | True if MQMD.Persistence is set to MQPER_PERSISTENT, false otherwise. |
priority | 4 | From mq_amqp.Hdr.Pri, if set, or otherwise from MQMD.Priority, if set. If neither set, set to 4. |
ttl | n/a | MQMD.Expiry in milliseconds. If the value of MQMD.Expiry is MQEI_UNLIMITED, then set to the maximum value for the AMQP ttl field |
first-acquirer | false | From mq_amqp.Hdr.Fac, if set, or false otherwise. |
delivery-count | 0 | From mq_amqp.Hdr.Dct, if set, or 0 otherwise. |
delivery-annotation
Set as necessary by the AMQP channel.
message-annotation
Not included.
properties
The properties will come unmodified from the equivalent mq_amqp.Prp properties if these are set. If the message was not originally an AMQP message (that is, PutApplType is not MQAT_AMQP), then a properties section is generated as described in the following table:
Name | Value |
---|---|
message-id | The MQMD.MsgId is set as binary. |
user-id | The UTF-8 form of the MQMD.UserIdentifier is set as binary in network byte-order. |
to | The queue that the message was got from, or, for a publication, the topic string. |
subject | Not set. |
reply-to | The MQMD.ReplyToQ if non-blank, otherwise not set. |
correlation-id | The MQMD.CorrelId is set as binary if non-blank, otherwise not set. |
content-type | Not set. |
content-encoding | Not set. |
absolute-expiry-time | Not set. |
creation-time | The MQMD.PutDate and MQMD.PutTime fields are used to generate a timestamp. |
group-id | Not set. |
group-sequence | Not set. |
reply-to-group-id | Not set. |
application-properties
All IBM MQ properties in the usr
group are
added as the application-properties.
body
The AMQP channel performs a get with convert, to convert the IBM MQ payload into UTF-8.
If the IBM MQ payload does not contain an AMQP message, then the IBM MQ payload is set in the body as a single string data section for Format MQFMT_STRING (provided conversion to UTF-8 was successful), or as a single binary data section otherwise.
If an AMQP format message is included, then this is set as the body. Any IBM MQ headers (not including the messages properties which are returned in a message handle) that precede the AMQP message are prepended as a binary value if the body is an AMQP Sequence. Otherwise the IBM MQ headers are discarded.
footer
No footer is included.
Parent topic: Mapping AMQP and IBM MQ message fieldsRelated information