Bug 549443

Summary: qpid-config cannot create bindings for the XML or Headers exchange types
Product: Red Hat Enterprise MRG Reporter: Ted Ross <tross>
Component: qpid-qmfAssignee: Ted Ross <tross>
Status: CLOSED ERRATA QA Contact: Frantisek Reznicek <freznice>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.2CC: esammons, fnadge, freznice, jneedle, lbrindle, tross
Target Milestone: 1.3   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Previously, qpid-config did not provide any access to the "arguments" field of an exchange-bind operation for header and xml exchanges because no binding key was set before the "any" or "all" keyword. With this update, users can specify needed parameters for queue to header and/or xml exchange binding.
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-10-14 16:15:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ted Ross 2009-12-21 17:53:34 UTC
qpid-config does not provide any access to the "arguments" field of an exchange-bind operation.

For the Headers exchange, the user must be able to specify an operator ('any' or 'all) and a set of key/value pairs.

For the XML exchange, the user must be able to supply an XQuery document.  This could be done via stdin or from an input file.  It would probably be good to use a well-established convention (i.e. "-" for stdin or "-f <filename>" for an input file)

Comment 1 jrd 2010-01-07 20:47:01 UTC
Fixed upstream in https://issues.apache.org/jira/browse/QPID-2327

Comment 3 Frantisek Reznicek 2010-09-27 14:43:05 UTC
Although the xlm exchange can be bound using both variants:
  cat /tmp/x.xml |  qpid-config bind xml1 X Y -f -
  qpid-config bind xml1 X Y -f /tmp/x.xml

There is problem with header exchange binding:

[root@mrg-qe-01 bz636262]# qpid-config add queue X
[root@mrg-qe-01 bz636262]# qpid-config add queue Y
[root@mrg-qe-01 bz636262]# qpid-config bind xml1 X X -f /tmp/x.xml
[root@mrg-qe-01 bz636262]# qpid-config bind xml2 Y X -f /tmp/x.xml
[root@mrg-qe-01 bz636262]# qpid-config bind xml2 X -f /tmp/x.xml
[root@mrg-qe-01 bz636262]# qpid-config bind head1 Y all k1=v1
Invalid args to bind headers:  need 'any'/'all' plus conditions
Failed: ValueError: need more than 1 value to unpack
[root@mrg-qe-01 bz636262]# qpid-config bind head1 Y  k1=v1
Invalid args to bind headers:  need 'any'/'all' plus conditions
Failed: ValueError: need more than 1 value to unpack
[root@mrg-qe-01 bz636262]# qpid-config bind head1 X  k1=v1
Invalid args to bind headers:  need 'any'/'all' plus conditions
Failed: ValueError: need more than 1 value to unpack
[root@mrg-qe-01 bz636262]# qpid-config bind head1 X any k1=v1,k2=v2
Invalid args to bind headers:  need 'any'/'all' plus conditions
Failed: ValueError: need more than 1 value to unpack
[root@mrg-qe-01 bz636262]# qpid-config bind head1 X any k1=v1 k2=v2
Invalid condition arg to bind headers, need 'any' or 'all', not 'k1=v1'
Failed: ValueError: need more than 1 value to unpack
[root@mrg-qe-01 bz636262]# qpid-config bind head1 X any k1=v1, k2=v2
Invalid condition arg to bind headers, need 'any' or 'all', not 'k1=v1,'
Failed: ValueError: need more than 1 value to unpack
[root@mrg-qe-01 bz636262]# qpid-config bind head1 X all k1=v1, k2=v2
Invalid condition arg to bind headers, need 'any' or 'all', not 'k1=v1,'
Failed: ValueError: need more than 1 value to unpack
[root@mrg-qe-01 bz636262]# qpid-config bind head1 X all k1=v1,k2=v2
Invalid args to bind headers:  need 'any'/'all' plus conditions
Failed: ValueError: need more than 1 value to unpack
[root@mrg-qe-01 bz636262]# qpid-config bind head1 X all {k1=v1,k2=v2}
Invalid condition arg to bind headers, need 'any' or 'all', not 'k1=v1'
Failed: ValueError: need more than 1 value to unpack
[root@mrg-qe-01 bz636262]# qpid-config bind head1 Y all k1=v1,k2=v2
Invalid args to bind headers:  need 'any'/'all' plus conditions
Failed: ValueError: need more than 1 value to unpack
[root@mrg-qe-01 bz636262]# qpid-config bind head1 Y all k1=v1, k2=v2
Invalid condition arg to bind headers, need 'any' or 'all', not 'k1=v1,'
Failed: ValueError: need more than 1 value to unpack


There seems to be no way how to bind headers exchange. Let me know if I'm missing there something. The source of commands above is from qpid-config --help & permutations/variations.

-> ASSIGNED

Comment 4 Ted Ross 2010-09-27 17:09:09 UTC
The issue here is in the help-string/usage for qpid-config which says the following with regard to the "bind" operation:

  qpid-config [OPTIONS] bind   <exchange-name> <queue-name> [binding-key]
            <for type xml>     [-f -|filename]
            <for type header>  [all|any] k1=v1 [, k2=v2...]

For XML and Headers exchanges, the binding-key is not optional and must be supplied before the "any" or "all" keyword.  In the above report, "all" is being interpreted as the binding key.

The reason the binding key is required is that without it, the binding cannot be deleted.  For XML and Headers exchanges, the binding key serves only as a handle by which a binding can be referred to.

Comment 5 Frantisek Reznicek 2010-09-29 07:40:08 UTC
I can confirm the above comment 4, testing with given <binding-key> works well. I believe qpid-config usage text should be modified or alternatively rel. note should describe this case.

Comment 6 Florian Nadge 2010-10-07 10:26:30 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Previously, qpid-config did not provide any access to the "arguments" field of an exchange-bind operation for header and xml exchanges. With this update, users can specify needed parameters for queue to header and/or xml exchange binding.

Comment 7 Florian Nadge 2010-10-07 10:39:47 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-Previously, qpid-config did not provide any access to the "arguments" field of an exchange-bind operation for header and xml exchanges. With this update, users can specify needed parameters for queue to header and/or xml exchange binding.+Previously, qpid-config did not provide any access to the "arguments" field of an exchange-bind operation for header and xml exchanges because no binding key was set before the "any" or "all" keyword. With this update, users can specify needed parameters (...) for queue to header and/or xml exchange binding.

Comment 8 Jeff Needle 2010-10-08 18:31:16 UTC
Covered by tech note, so moving to VERIFIED

Comment 9 Lana Brindley 2010-10-13 21:23:37 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-Previously, qpid-config did not provide any access to the "arguments" field of an exchange-bind operation for header and xml exchanges because no binding key was set before the "any" or "all" keyword. With this update, users can specify needed parameters (...) for queue to header and/or xml exchange binding.+Previously, qpid-config did not provide any access to the "arguments" field of an exchange-bind operation for header and xml exchanges because no binding key was set before the "any" or "all" keyword. With this update, users can specify needed parameters for queue to header and/or xml exchange binding.

Comment 11 errata-xmlrpc 2010-10-14 16:15:24 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2010-0773.html