Bug 1204130

Summary: released message is not marked as redelivered
Product: Red Hat Enterprise MRG Reporter: Petr Matousek <pematous>
Component: python-qpidAssignee: messaging-bugs <messaging-bugs>
Status: NEW --- QA Contact: Messaging QE <messaging-qe-bugs>
Severity: low Docs Contact:
Priority: low    
Version: DevelopmentCC: gsim, jross, zkraus
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1018746 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:
Embargoed:

Comment 1 Petr Matousek 2015-03-20 13:34:35 UTC
This issue is also valid for qpid::messaging python client with the difference that this applies to receiving from exchange only (when receiving from queue the redelivered flag is set as expected). So the reproduction scenario needs to be slightly changed:

Steps to Reproduce:
1. create a subscription from an exchange that releases incoming messages (use reliable link!)
2. send a message towards the exchange
3. the redelivered flag of the released message (which was returned to the exchange and acquired again) is set to false, but shall be true.

ie:
1. /var/dtests/node_data/clients/qc2_drain.py --f -c 2 --log-msgs dict --accept release "amq.direct;{link:{reliability:at-least-once}}"
2. $pyapi/spout "amq.direct"
3. the second acquired message shall have the redelivered flag set to true

--
Terminal transcript

PYTHON cli:
#  /var/dtests/node_data/clients/qc2_drain.py --f -c 2 --log-msgs dict --accept release "amq.direct;{link:{reliability:at-least-once}}"
{'redelivered': False, 'reply_to': None, 'subject': None...}
{'redelivered': False, 'reply_to': None, 'subject': None...}

C++ cli:
{'redelivered': False, 'reply_to': None, 'subject': None...}
{'redelivered': True, 'reply_to': None, 'subject': None...}

Comment 2 Petr Matousek 2015-03-20 15:35:47 UTC
(In reply to Petr Matousek from comment #1)
> This issue is also valid for qpid::messaging python client with the
> difference that this applies to receiving from exchange only

Correction: applies to queues as well:

1. create a queue and send a message towards it
2. acquire and release the message
3. acquire again the released message (which was returned to the queue)
4. redelivered flag is set to false, but shall be true

--
--
Terminal transcript

./spout.py "q;{create:always}"

PYTHON cli:
./var/dtests/node_data/clients/qc2_drain.py --log-msgs dict -c 2 --accept release q
{'redelivered': False, 'reply_to': None, 'subject': None...}
{'redelivered': False, 'reply_to': None, 'subject': None...}

C++ cli:
{'redelivered': False, 'reply_to': None, 'subject': None...}
{'redelivered': True, 'reply_to': None, 'subject': None...}

Comment 4 Gordon Sim 2015-03-23 16:22:52 UTC
The API in python allows the 'set-redelivered' flag, defined by AMQP 0-10, to be controlled by the application, e.g.

    ssn.acknowledge(msg, Disposition(RELEASED, set_redelivered=True))

If that is done, then it should be marked redelivered on subsequent retrieval.

Comment 5 Petr Matousek 2015-03-24 10:24:03 UTC
(In reply to Gordon Sim from comment #4)
> The API in python allows the 'set-redelivered' flag, defined by AMQP 0-10,
> to be controlled by the application, e.g.
> 
>     ssn.acknowledge(msg, Disposition(RELEASED, set_redelivered=True))
> 
> If that is done, then it should be marked redelivered on subsequent
> retrieval.

Correct, It's not done by default (like with other clients), ie:
  ssn.acknowledge(msg, Disposition(RELEASED)

but it may be explicitly set by the application
  ssn.acknowledge(msg, Disposition(RELEASED, set_redelivered=True))

Although this is a bit inconsistent, it makes this issue a very low priority in my eyes.