diff options
| author | Kenneth Anthony Giusti <kgiusti@apache.org> | 2012-02-02 23:46:35 +0000 |
|---|---|---|
| committer | Kenneth Anthony Giusti <kgiusti@apache.org> | 2012-02-02 23:46:35 +0000 |
| commit | e8390c4d8043854248db18fa794fa7cd6b105016 (patch) | |
| tree | 7e6fb0ab394073f510c3e9e676e752860e91afc2 /qpid/tests/src | |
| parent | 323e2e53e21c5cabdb6790465a3358cdd0de3c73 (diff) | |
| download | qpid-python-e8390c4d8043854248db18fa794fa7cd6b105016.tar.gz | |
QPID-3804: do not skip released grouped messages
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1239939 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/tests/src')
| -rw-r--r-- | qpid/tests/src/py/qpid_tests/broker_0_10/msg_groups.py | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/qpid/tests/src/py/qpid_tests/broker_0_10/msg_groups.py b/qpid/tests/src/py/qpid_tests/broker_0_10/msg_groups.py index 99d11151e8..4d6d77a46f 100644 --- a/qpid/tests/src/py/qpid_tests/broker_0_10/msg_groups.py +++ b/qpid/tests/src/py/qpid_tests/broker_0_10/msg_groups.py @@ -1068,6 +1068,55 @@ class MultiConsumerMsgGroupTests(Base): self.qmf_session.delBroker(self.qmf_broker) + def test_transaction_order(self): + """ Verify that rollback does not reorder the messages with respect to + the consumer (QPID-3804) + """ + snd = self.ssn.sender("msg-group-q; {create:always, delete:sender," + + " node: {x-declare: {arguments:" + + " {'qpid.group_header_key':'THE-GROUP'," + + "'qpid.shared_msg_group':1}}}}") + + groups = ["A","B","A"] + messages = [Message(content={}, properties={"THE-GROUP": g}) for g in groups] + index = 0 + for m in messages: + m.content['index'] = index + index += 1 + snd.send(m) + + s1 = self.conn.session(transactional=True) + c1 = s1.receiver("msg-group-q", options={"capacity":0}) + + # C1 gets group A + m1 = c1.fetch(0) + assert m1.properties['THE-GROUP'] == 'A' + assert m1.content['index'] == 0 + s1.acknowledge(m1) + + s1.rollback() # release A back to the queue + + # the order should be preserved as follows: + + m1 = c1.fetch(0) + assert m1.properties['THE-GROUP'] == 'A' + assert m1.content['index'] == 0 + + m2 = c1.fetch(0) + assert m2.properties['THE-GROUP'] == 'B' + assert m2.content['index'] == 1 + + m3 = c1.fetch(0) + assert m3.properties['THE-GROUP'] == 'A' + assert m3.content['index'] == 2 + + s1.commit() + + c1.close() + s1.close() + snd.close() + + class StickyConsumerMsgGroupTests(Base): """ Tests for the behavior of sticky-consumer message groups. These tests |
