Bug 834256

Summary: Alternate exchange is not applied when defined in the link properties
Product: Red Hat Enterprise MRG Reporter: Petr Matousek <pematous>
Component: qpid-cppAssignee: Gordon Sim <gsim>
Status: CLOSED ERRATA QA Contact: Petr Matousek <pematous>
Severity: high Docs Contact:
Priority: medium    
Version: 2.1.2CC: iboverma, jross, lzhaldyb, mcressma
Target Milestone: 2.3   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qpid-cpp-0.18-1 Doc Type: Bug Fix
Doc Text:
Cause: The alternate-exchange option in an x-declare clause within the link-options of an address was being ignored. Consequence: The alternate exchange property could not be controlled via the link options. Fix: Alternate exchange option is not checked and used if specified. Result: The alternate-exchange can be controlled on queues created through the link options in an address.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-03-06 18:56:08 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:
Attachments:
Description Flags
test reproducer none

Description Petr Matousek 2012-06-21 11:04:06 UTC
Description of problem:

When the alternate exchange is defined in the link properties, the alternate exchange setting is not applied, regardless if defined for queue, subscription queue or exchange (defining alt-ex in node properties does not suffer from that).

qpid-config can be used to display that the alt-ex setting was not applied  (before the link is closed).

Version-Release number of selected component (if applicable):
qpid-cpp-mrg-0.14-14.el5

How reproducible:
100%

Steps to Reproduce:
1.  spout "test_q;{create: always, delete:always, link:{x-declare:{alternate-exchange:'amq.fanout'}}}"
2. use 'qpid-stat -e' to discover that no message arrived at the 'amq.fanout'

OR

1. run the attached test reproducer
2. test fails with: "0 != 5 Assertion fail, All 5 messages should have been routed to the alt_exchange"
  
Actual results:
Alternate exchange defined in the link properties is not applied.

Expected results:
Alternate exchange defined in the link properties is applied.
No failure by running the test reproducer.

Comment 1 Petr Matousek 2012-06-21 11:07:40 UTC
Created attachment 593419 [details]
test reproducer

Comment 2 Petr Matousek 2012-06-22 09:42:27 UTC
Correction:
The first reproduction scenario in Comment 1 is wrong (link properties won't apply on the node test_q):

following reproduction scenario can be used instead:
1.) create a subscription queue that will be removed after one message fetch
# drain -c 1 -t 60 "amq.direct/key;{link:{x-declare:{alternate-exchange:'amq.fanout'}}}"
2.) in the second cli send 6 messages to amq.direct:
# spout -c 6 amq.direct/key
3.) use 'qpid-stat -e' to discover that no message arrived at the 'amq.fanout'

Expected result: qpid-stat shows 5 messages on the 'amq.fanout'

--

the second reproduction scenario (using the reproducer) is correct

Comment 3 Petr Matousek 2012-06-22 11:12:57 UTC
(In reply to comment #2)

Note: I've forget to mention that drain has to be slightly modified, it is necessary to add some sleep (ie.sleep(1)) before the link is closed, to guarantee that the messages are firstly delivered to the subscription queue.

Comment 4 Petr Matousek 2012-06-22 12:12:39 UTC
(In reply to comment #0)
Update/Clarification:
- When the alternate exchange is defined in the link properties, the alternate
- exchange setting is not applied, regardless if defined for queue,
- subscription queue or exchange (defining alt-ex in node properties does not
- suffer from that).

+ When the alternate exchange is defined in the link properties for a subscription queue, the alternate exchange setting is not applied.

Comment 5 Gordon Sim 2012-07-06 18:07:42 UTC
Fixed upstream: http://svn.apache.org/viewvc?view=revision&revision=1358321

Comment 7 Petr Matousek 2012-10-27 12:59:30 UTC
This issue has been fixed.

Verified on rhel5.8 and rhel6.3 (x86_64, i386)

packages used for testing:
qpid-cpp-0.18-1

-> VERIFIED

Comment 9 errata-xmlrpc 2013-03-06 18:56:08 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/RHSA-2013-0561.html