5.8. Message grouping

Messages can be grouped using the ImqMessage Tracker setGroupId method. We also have to identify messages in the group by giving the MQMF_MSG_IN_GROUP or MQMF_LAST_MSG_IN_GROUP flags using the ImqMessage setMessageFlags method.

Example 5-6 on page 152 shows how to send three messages as a group. The first two messages will be sent using the MQMF_MSG_IN_GROUP flag while the third message will use the MQMF_LAST_MSG_IN_GROUP.

Example 5-6. Message grouping
 // Setting put message options and message descriptor versions. message descriptor versions. BYTE24 MY_GROUP_ID = "123456"; ImqPutMessageOptions pmo; ImqMessage message; ImqBinary grpId; // Set the grpId binary object value grpId.set(MY_GROUP_ID,sizeof(MY_GROUP_ID); // Sets ...

Get MQSeries Programming Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.