4.8. Grouping

AMI allows a sequence of related messages to be included in, and sent as, a message group. Group context information is sent with each message to allow the message sequence to be preserved and made available to a receiving application. In order to include messages in a group, the group status information of the first and subsequent messages in the group must be set as follows:

  • AMGRP_FIRST_MSG_IN_GROUP for the first message

  • AMGRP_MIDDLEMSG_IN_GROUP for all the messages other than the first and last

  • AMGRP_LAST_MSG_IN_GRP for the last message

This can be achieved by using the setGroupStatus() method of the message class.

messageObject.setGroupStatus(int groupStatus)

The groupStatus can be any of the following values:

  • AMGRP_MSG_NOT_IN_GROUP ...

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.