diff options
Diffstat (limited to 'qpid/cpp/src')
| -rw-r--r-- | qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp | 2 | ||||
| -rwxr-xr-x | qpid/cpp/src/tests/ha_tests.py | 15 |
2 files changed, 16 insertions, 1 deletions
diff --git a/qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp b/qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp index 46175fd2e4..645918d526 100644 --- a/qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp +++ b/qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp @@ -97,7 +97,7 @@ pair<Exchange::shared_ptr, bool> ExchangeRegistry::declare( durable, false, ManagementAgent::toMap(result.first->getArgs()), - "created")); + result.second ? "created" : "existing")); } } return result; diff --git a/qpid/cpp/src/tests/ha_tests.py b/qpid/cpp/src/tests/ha_tests.py index 587a150dda..77399bf2e2 100755 --- a/qpid/cpp/src/tests/ha_tests.py +++ b/qpid/cpp/src/tests/ha_tests.py @@ -885,6 +885,21 @@ acl deny all all cluster[2].wait_address("xx") self.assertEqual(cluster[2].agent().getExchange("xx").values["bindingCount"], 0) + def test_redeclare_exchange(self): + """Ensure that re-declaring an exchange is an HA no-op""" + cluster = HaCluster(self, 2) + ps = cluster[0].connect().session() + ps.sender("ex1;{create:always,node:{type:topic,x-declare:{arguments:{'qpid.replicate':all}, type:'fanout'}}}") + ps.sender("ex2;{create:always,node:{type:topic,x-declare:{arguments:{'qpid.replicate':all}, type:'fanout', alternate-exchange:'ex1'}}}") + cluster[1].wait_backup("ex1") + cluster[1].wait_backup("ex2") + + # Use old API to re-declare the exchange + old_conn = cluster[0].connect_old() + old_sess = old_conn.session(str(qpid.datatypes.uuid4())) + old_sess.exchange_declare(exchange='ex1', type='fanout') + cluster[1].wait_backup("ex1") + def fairshare(msgs, limit, levels): """ Generator to return prioritised messages in expected order for a given fairshare limit |
