Bug 920706 - QMF attempt to create already existing binding should raise an error
Summary: QMF attempt to create already existing binding should raise an error
Keywords:
Status: NEW
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-qmf
Version: 2.3
Hardware: All
OS: Linux
low
low
Target Milestone: 3.2
: ---
Assignee: messaging-bugs
QA Contact: Messaging QE
URL:
Whiteboard:
Depends On: 916953
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-03-12 15:14 UTC by Pavel Moravec
Modified: 2020-11-04 22:33 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
patch proposal (911 bytes, patch)
2014-03-11 11:01 UTC, Pavel Moravec
no flags Details | Diff

Description Pavel Moravec 2013-03-12 15:14:41 UTC
Description of problem:
When creating (via QMF) a binding such that the tripple (exchange, bindingKey, queue) already exists for another binding, this new create attempt should fail and QMF should warn the binding has not been created (or even updated). This is a valid request for any exchange type.


Version-Release number of selected component (if applicable):
MRG 2.3


How reproducible:
100%


Steps to Reproduce:
qpid-config add queue MyQueue
qpid-config bind amq.fanout MyQueue
qpid-config bind amq.fanout MyQueue 
echo $?
qpid-config bind amq.direct MyQueue SomeKey
qpid-config bind amq.direct MyQueue SomeKey
echo $?
qpid-config bind amq.topic MyQueue SomeKey
qpid-config bind amq.topic MyQueue SomeKey
echo $?
qpid-config bind amq.topic MyQueue Some.Key
qpid-config bind amq.topic MyQueue Some.Key
echo $?
qpid-config bind amq.topic MyQueue Some.#.Key
qpid-config bind amq.topic MyQueue Some.#.Key
echo $?
qpid-config bind amq.match MyQueue SomeKey any property1=value1
qpid-config bind amq.match MyQueue SomeKey all property1=value1
echo $?
qpid-config bind amq.match MyQueue SomeKey all property1=value1
echo $?
qpid-config add exchange xml amq.xml
echo "declare variable \$headerKey external; \$headerKey = 1" > xquery1.xq
echo "declare variable \$headerKey external; \$headerKey = 2" > xquery2.xq
qpid-config bind amq.xml MyQueue SomeKey -f xquery1.xq
qpid-config bind amq.xml MyQueue SomeKey -f xquery2.xq
echo $?

  
Actual results:
All $? returns 0


Expected results:
All $? to return 1


Additional info:

Comment 1 Pavel Moravec 2014-03-11 11:01:18 UTC
Created attachment 873056 [details]
patch proposal

If queue->bind(..) method returns false (in fact exchange->bind(..) does so) and the bind request was not federation originated, raise exception.

BUT this will cause second instance of below command to fail:

qpid-receive -a "MyQueue; {create:always, node:{ x-bindings: [{ exchange:'amq.fanout', queue:'MyQueue' }] }}"

While it makes sense to re-use the address string..

/me was thinking about raising WARN message there rather.


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