Bug 1045092 - [amqp1.0] don't increment the delivery count for prefetched message not delivered to application
Summary: [amqp1.0] don't increment the delivery count for prefetched message not deliv...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-cpp
Version: Development
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: 3.0
: ---
Assignee: Gordon Sim
QA Contact: Irina Boverman
URL:
Whiteboard:
Depends On:
Blocks: 1081162
TreeView+ depends on / blocked
 
Reported: 2013-12-19 15:12 UTC by Petr Matousek
Modified: 2015-01-21 12:57 UTC (History)
4 users (show)

Fixed In Version: qpid-cpp-0.22-35
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1081162 (view as bug list)
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Apache JIRA QPID-5509 0 None None None Never

Description Petr Matousek 2013-12-19 15:12:42 UTC
Description of problem:

The delivery count for receiver's prefetched messages is increased even if the messages was not seen by the application.

# qpid-send --messages 3 --address "q;{create:sender}"
# qpid-receive --connection-options {protocol:amqp1.0} --print-headers true --messages 1 --address q
Properties: {sn:1, ts:1387456209158654200}
# qpid-receive --connection-options {protocol:amqp1.0} --print-headers true --messages 1 --address q
Redelivered: true
Properties: {sn:2, ts:1387456209158736790, x-amqp-delivery-count:1}

The redelivered flag is set to true and x-amqp-delivery-count is increased

When the capacity is set to be 0, the behavior is as expected:

# qpid-send --messages 10 --address "q;{create:sender}"
# qpid-receive --capacity 0 --connection-options {protocol:amqp1.0} --print-headers true --messages 1 --address q
Properties: {sn:1, ts:1387463670006783616}
# qpid-receive --capacity 0 --connection-options {protocol:amqp1.0} --print-headers true --messages 1 --address q
Properties: {sn:2, ts:1387463670006894302}

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

How reproducible:
100%

Steps to Reproduce:
1. send a message using qpid-send (use default capacity)
2. receive single message
3. receive next message
4. the message is marked as redelivered and x-amqp-delivery-count is increased

Actual results:
Delivery count increased and redelivered flag set for prefetched messages

Expected results:
Messages that was not seen by the application shall not be marked redelivered and the delivery caount shall not be increased.

Additional info:

Not exactly sure what shall be the correct behavior here, feel free to change to doc bug when this issue will be identified as correct behavior.

See bug 975422, comment 2

Comment 1 Gordon Sim 2014-01-23 16:08:50 UTC
Fixed upstream: https://svn.apache.org/r1560718

Now, when a receiver is closed, any prefetched messages - those delivered to the client by the broker that have not been returned to the application - will be released, which prevents the delivery count being incremented.


Note You need to log in before you can comment on or make changes to this bug.