Bug 1018749

Summary: When a message is browsed the redelivered flag is always set to true
Product: Red Hat Enterprise MRG Reporter: Petr Matousek <pematous>
Component: qpid-cppAssignee: Gordon Sim <gsim>
Status: CLOSED ERRATA QA Contact: Petr Matousek <pematous>
Severity: medium Docs Contact:
Priority: medium    
Version: DevelopmentCC: gsim, iboverma, jross, lzhaldyb, zkraus
Target Milestone: 3.0   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qpid-cpp-0.22-22 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-24 15:08:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Petr Matousek 2013-10-14 11:09:23 UTC
Description of problem:

When a browser obtains a message, the message is marked as redelivered even if was never acquired by other client. Moreover, when the message is consumed by a consumer after it was browsed the redelivered flag is false (even if the browser gets "redelivered" message, message received using consumer is not marked as redelivered).

Note: I'm not sure if the message shall be marked as redelivered after it was browsed, the documentation does not mention this case. 

Note: this applies to both amqp0-10 and amqp1.0 protocols

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

How reproducible:
100%

Steps to Reproduce:
1. create a queue and send message towards it
2. browse the message on the queue and realize that the message has the redelivered flag set to true
3. consume the message and realize that the message has the redelivered flag set to false

Actual results:
1. Browsed message is always marked as redelivered
2. message consumed after it was browsed is not marked as redelivered

Expected results:
either:
Do not mark browsed messages as redelivered at all
or:
Mark the message as redelivered, after it was browsed
ie. first browser gets message with redelivered flag set to false, any other browser/consumer obtains this message with redelivered flag set to true

Additional info:

Comment 1 Gordon Sim 2013-10-15 12:56:01 UTC
Fixed upstream: https://svn.apache.org/r1532304, also added test: https://svn.apache.org/r1532310

Comment 3 Petr Matousek 2013-10-22 09:41:45 UTC
This issue has been fixed. Verified on rhel6.4 (i386, x86_64).

Browsing messages do not set the redelivered flag to true.

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

Comment 4 Petr Matousek 2013-10-23 13:22:16 UTC
Unfortunately the issue is not fixed for amqp1.0:

# spout "q;{create:always}"
# qc2_drain --log-msg-dict --connection-options "{protocol:'amqp1.0'}" "q;{mode:browse}"
{'redelivered': True, 'reply-to': None, 'subject': None, 'content_type': None, 'id': None, 'user_id': None, 'correlation_id': None, 'priority': None, 'durable': False, 'ttl': 0, 'size': 0, 'properties': {'spout-id': '2def6005-ead8-4aa0-9dce-50f8c6d0b0eb:0', 'x-amqp-delivery-count': 4294967295}, 'content': None}

-> ASSIGNED

Comment 5 Gordon Sim 2013-10-23 15:04:54 UTC
Sorry! The 1.0 path is now also fixed upstream: https://svn.apache.org/r1535048

Comment 8 Petr Matousek 2013-10-25 09:51:09 UTC
This issue has been fixed for both the protocols (amqp0-10/1.0). Verified on rhel6.4 (i386, x86_64).

Browsing messages do not set the redelivered flag to true.

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

Comment 9 errata-xmlrpc 2014-09-24 15:08:55 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2014-1296.html