Message structure

In this post i will explain how mq messages are structured.

An mq message contains two main sections. (It can be compared to JMS where a message is slipt as JMS Header and JMS data)

The header and the data.

  1. The Header:
    1. The header contains the MQMD (Message Queue Message Descriptor) with all the usefull information to handle the message metadata.
  2. The data:
    1. The data contains three different informations.
      1. The MQ RFH 1: RFH contains usefull metadata information sur as:
        1. The reply to Q for dynamic reply response.
        2. The DLQ name in case of technical error.
        3. The persistence flag: Keep the message in case of mq restart or not.
        4. The message type.
        5. The priority number: long representing the value to prioritze read messages.
        6. Group Id: read based by group number for security context.
        7. The sequence number: in case of partitionned data into multiple messages.
      2. The MQ RFH 2: RFH 2 contains usefull metadata information sur as:
        1. Version.
        2. CCSID: Code Char Set ID as long value (for instance 1208 is UTF-8, 1200 is UTF-16, 13488 is UTF-16 V2, 17584 is UTF-16 V3).
        3. Encoding: Encoding as long value represent carriage return representation for OS usage of MQ, 273 is for Unix systems and 546 is for Linux and Windows systems
        4. Format: Format will be MQHRF2.
        5. Sturcture Lenght: Size in bytes of MQRFH 2.
      3. The payload:
        1. The data payload can be:
          1. Binary
          2. XML
          3. JSON
          4. DFDL
          5. MIME
          6. MRM
          7. CUSTOM

It is possible to convert an MQ message to JMS message and inversly. (On this topic there are two nodes on ACE allowing to do it: See the post List of Nodes JMSMQTransform and MQJMSTransform.)