6.8.2. Create a Queue with Message Groups enabled
To create a queue with message groups enabled, specify values for
qpid.group_header_key
and qpid.shared_msg_group
in the queue creation arguments.
The
qpid.group_header_key
is the header key that will be used to match messages on. Messages with the same value for this key in their header belong to the same group.
qpid.shared_msg_group
should be set to 1
.
The following example creates an auto-deleting queue that uses the header field "msgGroupID" to group messages:
- Python
groupedSender = session.sender("my-grouped-msg-queue; {create: always, node: {x-declare: {auto-delete: True, arguments: {'qpid.group_header_key': 'msgGroupID', 'qpid.shared_msg_group': 1}}}}")
- C++
Sender groupedSender = session.createSender("my-grouped-msg-queue; {create:always, node: {x-declare: {auto-delete: True, arguments: {'qpid.group_header_key':'msgGroupID', 'qpid.shared_msg_group':1}}}}")