Description of problem: When trying to create an exchange of different type with the same name as already existing exchange, no error message is displayed and return code is equal to 0 using the amqp1.0 client. Following error is displayed using other clients: Create failed for exchange ex; not-allowed: not-allowed: Exchange declared to be of type topic, requested fanout (/builddir/build/BUILD/qpid-0.22/cpp/src/qpid/broker/SessionAdapter.cpp:120) This puts amqp0-10 and 1.0 out of sync. Version-Release number of selected component (if applicable): qpid-cpp-*-0.22-14 How reproducible: 100% Steps to Reproduce: 1. spout --connection-options {protocol:amqp1.0} "ex;{create: always,node:{type: topic,x-declare:{type:topic}}}" 2. spout --connection-options {protocol:amqp1.0} "ex;{create: always,node:{type: topic,x-declare:{type:fanout}}}" 3. echo $? Actual results: No error message displayed, return value is equal to 0 Expected results: Error message is displayed, return value is non-zero
Fixed upstream: https://svn.apache.org/r1525040
Also needs https://svn.apache.org/r1525541 for compilation on RHEL.
The issue has been fixed. Verified on RHEL6.4 (i386, x86_64) packages installed: qpid-cpp-*-0.22-29 -> VERIFIED
There is a side effect of this change, the exception is displayed even if the exchange type is not specified in the address (if the exchange already exist): qpid-send -a "amq.direct; {create:always, node:{type:topic}}" --connection-options="{protocol:amqp1.0}" qpid-send: Link detached by peer with amqp:precondition-failed: Exchange of different type already exists (message not sent, exception received, return code 1) using amqp0-10: # qpid-send -a "amq.direct; {create:always, node:{type:topic}}" (message sent, no exception, return code 0)
Issue in comment #4 fixed upstream by https://svn.apache.org/r1555106
Added 1555106 to 0.22-mrg.
Both the original issue and the issue from comment 4 has been fixed. Verified on RHEL6.5 (i386, x86_64) packages installed: qpid-cpp-*-0.22-30 -> VERIFIED