Bug 1010955

Summary: [amqp1.0] message group-id is not applied on amqp1.0 messages
Product: Red Hat Enterprise MRG Reporter: Petr Matousek <pematous>
Component: qpid-cppAssignee: Gordon Sim <gsim>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Matousek <pematous>
Severity: high Docs Contact:
Priority: high    
Version: DevelopmentCC: esammons, gsim, iboverma, jross
Target Milestone: 3.0   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qpid-cpp-0.22-17 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1010399    

Description Petr Matousek 2013-09-23 11:28:33 UTC
Description of problem:

When a amqp1.0 message is sent to message groups queue (regardless if defined with 0-10 or 1.0), the group key is not properly applied and all the messages belongs to qpid.no-group. Thus when a message is acquired and not accepted yet, another client fails to obtain messages, because all of them belongs to the same group.

---

I've noticed also another issue:
When message group queue is defined using amqp0-10 following info is listed by qpid-tools.

qpid-config queues:
MyMsgQueue                                --group-header=GROUP_KEY --shared-groups
qpid-tool list queue:
arguments              {u'qpid.group_header_key': u'GROUP_KEY', u'qpid.shared_msg_group': 1}

When defining a message group queue using amqp1.0 then, qpid-tools shows the following:

qpid-config queues:
MyMsgQueue                                             --group-header=GROUP_KEY
qpid-tool list queue:
arguments              {u'qpid.group_header_key': 'GROUP_KEY', u'qpid.shared_msg_group': '1'}

The '--shared-groups' option is not listed using qpid-config.
The desired argument seems to be set as shown by qpid-tool, there is only one difference - the value seems to by of type string

On the other hand, currently only '--shared-group' option is supported for message groups and should be default, so I don't expect any issues here.

Version-Release number of selected component (if applicable):
qpid-cpp-*-0.22-15

How reproducible:
100%

Steps to Reproduce:
1. define a message groups queue, ie:
drain --connection-options "{protocol:'amqp1.0'}" "MyMsgQueue; {create:always, node: {x-declare: {arguments: {'qpid.group_header_key':'GROUP_KEY', 'qpid.shared_msg_group':1}}}}"
2. send messages several message on the message groups queue (ie. with groups keys 'A', 'A', 'B') 
spout --connection-options "{protocol:'amqp1.0'}" -P GROUP_KEY=A --content "a1" MyMsgQueue
spout --connection-options "{protocol:'amqp1.0'}" -P GROUP_KEY=A --content "a2" MyMsgQueue
spout --connection-options "{protocol:'amqp1.0'}" -P GROUP_KEY=B --content "b1" MyMsgQueue
3. use query command of qpid-tool to realize that all the messages on that queue belongs to qpid.no-group, ie:
call <broker-id> query queue MyMsgQueue
4. acquire a message using one consumer, do not accept yet
5. consume a message using another consumer
6. no message available for the second consumer because all the messages belongs to the same group (consumer shall consume 'B' group message)

Actual results:
message group functionality is not working

Expected results:
message group functionality properly working

Additional info:

Comment 1 Gordon Sim 2013-09-23 13:27:00 UTC
Fixed upstream: https://svn.apache.org/r1525584

Comment 2 Petr Matousek 2013-10-23 08:53:55 UTC
This issue has been fixed. Verified on rhel6.4 (i386, x86_64).

packages used for testing:
qpid-cpp-*-0.22-20.el6

-> VERIFIED