Bug 1183140

Summary: Do not reset delivery count and first acquirer fields on rejected and rerouted messages
Product: Red Hat Enterprise MRG Reporter: Petr Matousek <pematous>
Component: qpid-cppAssignee: 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: 3.3   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 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:
Embargoed:
Attachments:
Description Flags
Reproducer none

Description Petr Matousek 2015-01-16 19:12:18 UTC
Description of problem:

When a message is rerouted to the alternate exchange due to the message rejection, the reset of x-amqp-first-acquirer and x-amqp-delivery-count is done, which is not desired.

This is only done for rejected message, not for messages rerouted for other reason (e.g. orphaned, or explicit qmf reroute request). So, it is probably needless inconsistency.

For more details please see bug 1059786, comment 9.
According to gsim comment it affects both amqp1.0 and amqp0-10.

Version-Release number of selected component (if applicable):
qpid-cpp-*-0.30-5

How reproducible:
100%

Steps to Reproduce:
1. create a queue with alternate exchange defined
2. send a message towards the queue
3. subscribe to the alternate exchange
4. acquire and reject the message from the queue
5. list the properties of the message consumed from the alternate exchange:
     the 'x-amqp-first-acquirer' is set to True (false expected ~ the field shall not be present in the message properties map)
     the 'x-amqp-delivery-count' is equal to zero ~ not present in the properties map (non-zero value expected)

Actual results:
x-amqp-first-acquirer, x-amqp-delivery-count message fields reset is done when rejected message is rerouted to the alternate exchange

Expected results:
x-amqp-first-acquirer, x-amqp-delivery-count message fields reset is _not_ done when rejected message is rerouted to the alternate exchange

Additional info:

Comment 1 Petr Matousek 2015-01-16 19:18:48 UTC
Created attachment 980900 [details]
Reproducer

To compile:
g++ -lqpidmessaging 1183140.cpp -o 1183140

To run:
service qpidd restart
./1183140

Actual results:
Message properties: {x-amqp-first-acquirer:True}

Expected results:
Message properties: {x-amqp-delivery-count:1}