Bug 1006976 - [amqp1.0] consumer subscribed to xml exchange using xquery filter acquires always the same message
[amqp1.0] consumer subscribed to xml exchange using xquery filter acquires al...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-cpp (Show other bugs)
Development
Unspecified Unspecified
medium Severity high
: 3.0
: ---
Assigned To: Gordon Sim
Petr Matousek
:
Depends On:
Blocks: 1010399
  Show dependency treegraph
 
Reported: 2013-09-11 11:43 EDT by Petr Matousek
Modified: 2015-01-21 07:55 EST (History)
3 users (show)

See Also:
Fixed In Version: qpid-cpp-0.22-14
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-01-21 07:55:48 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Petr Matousek 2013-09-11 11:43:56 EDT
Description of problem:

When a consumer is subscribed for receiving messages from xml exchange using xquery filter, he always acquires the same message after the first matching message is delivered to him.

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

How reproducible:
100%

Steps to Reproduce:
1. declare exchange of type xml
# qpid-config add exchange xml xml
2. subscribe to the xml exchange using xquery-filter
# ./drain -f --connection-options "{protocol: 'amqp1.0'}" "xml;{link:{filter:{value:\"./colour='red' or ./colour='black'\",name:'name',descriptor:'apache.org:xquery-filter:string'}}}"
3. send two messages matching the filter with different content using 0-10 publisher
# ./spout --content '<colour>'red'</colour>' xml
# ./spout --content '<colour>'black'</colour>' xml
4. two messages are received (as expected), but the second message is the same message as the first one

Note: The behavior is the same when another client (ie. qpid-send) is used

Please see additional info for more details.

Actual results:
Only the first message matching the filter on the xml exchange subscription is delivered to the consumer. When another message matching the filter is published to the xml exchange, the consumer acquires again the first message (that was already deliver to him).

Expected results:
All the messages matching the filter are delivered to the consumer

Additional info:

term1 (consumer):
# qpid-config add exchange xml xml
# ./drain -f --connection-options "{protocol: 'amqp1.0'}" "xml;{link:{filter:{value:\"./colour='red' or ./colour='black'\",name:'name',descriptor:'apache.org:xquery-filter:string'}}}"
Message(properties={spout-id:8057661c-0e63-45a3-8275-4713175cd0c4:0, x-amqp-to:xml}, content='<colour>red</colour>')
Message(properties={spout-id:8057661c-0e63-45a3-8275-4713175cd0c4:0, x-amqp-to:xml}, content='<colour>red</colour>')

term2 (publisher):
# ./spout --content '<colour>'red'</colour>' xml
# ./spout --content '<colour>'black'</colour>' xml
Comment 1 Gordon Sim 2013-09-11 12:20:12 EDT
This is fixed by https://bugzilla.redhat.com/show_bug.cgi?id=1004002

A workaround is to explicitly clear the message after each fetch, e.g. by adding

  message = Message();

at the end of the while loop in drain.cpp
Comment 2 Petr Matousek 2013-10-25 11:15:13 EDT
This issue has been fixed. Verified on rhel6.4 (i386, x86_64).

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

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