summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2009-10-30 15:53:30 +0000
committerTed Ross <tross@apache.org>2009-10-30 15:53:30 +0000
commit9d7766a2e7e7a9172647d0a7a27b2306158f1786 (patch)
tree39618f76e7f2a3a085e2a5ffd58497390e633f37
parentab794904145b2e6a79da063f1aec9ae87953ea22 (diff)
downloadqpid-python-9d7766a2e7e7a9172647d0a7a27b2306158f1786.tar.gz
QPID-2181 - Alternate exchange on queue is not visible in management tools
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@831351 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--cpp/src/qpid/broker/Queue.cpp6
-rwxr-xr-xcpp/src/tests/cli_tests.py14
-rwxr-xr-xpython/commands/qpid-config2
-rw-r--r--specs/management-schema.xml9
4 files changed, 27 insertions, 4 deletions
diff --git a/cpp/src/qpid/broker/Queue.cpp b/cpp/src/qpid/broker/Queue.cpp
index 6496840b0b..b76581c60d 100644
--- a/cpp/src/qpid/broker/Queue.cpp
+++ b/cpp/src/qpid/broker/Queue.cpp
@@ -953,6 +953,12 @@ Queue::shared_ptr Queue::decode ( QueueRegistry& queues, Buffer& buffer, bool re
void Queue::setAlternateExchange(boost::shared_ptr<Exchange> exchange)
{
alternateExchange = exchange;
+ if (mgmtObject) {
+ if (exchange.get() != 0)
+ mgmtObject->set_altExchange(exchange->GetManagementObject()->getObjectId());
+ else
+ mgmtObject->clr_altExchange();
+ }
}
boost::shared_ptr<Exchange> Queue::getAlternateExchange()
diff --git a/cpp/src/tests/cli_tests.py b/cpp/src/tests/cli_tests.py
index 4309b66271..a65097d431 100755
--- a/cpp/src/tests/cli_tests.py
+++ b/cpp/src/tests/cli_tests.py
@@ -127,6 +127,7 @@ class CliTests(TestBase010):
self.startQmf();
qmf = self.qmf
exName = "testalt"
+ qName = "testqalt"
altName = "amq.direct"
ret = os.system(self.command(" add exchange topic %s --alternate-exchange=%s" % (exName, altName)))
@@ -145,6 +146,19 @@ class CliTests(TestBase010):
self.assertEqual(exchange._altExchange_.name, altName)
self.assertEqual(found, True)
+ ret = os.system(self.command(" add queue %s --alternate-exchange=%s" % (qName, altName)))
+ self.assertEqual(ret, 0)
+
+ queues = qmf.getObjects(_class="queue")
+ found = False
+ for queue in queues:
+ if queue.name == qName:
+ found = True
+ if not queue.altExchange:
+ self.fail("Alternate exchange not set")
+ self.assertEqual(queue._altExchange_.name, altName)
+ self.assertEqual(found, True)
+
def test_qpid_route(self):
self.startQmf();
qmf = self.qmf
diff --git a/python/commands/qpid-config b/python/commands/qpid-config
index 4cf9505c58..39af67f39c 100755
--- a/python/commands/qpid-config
+++ b/python/commands/qpid-config
@@ -246,6 +246,8 @@ class BrokerManager:
if LVQ in args and args[LVQ] == 1: print "--order lvq",
if LVQNB in args and args[LVQNB] == 1: print "--order lvq-no-browse",
if QUEUE_EVENT_GENERATION in args: print "--generate-queue-events=%d" % args[QUEUE_EVENT_GENERATION],
+ if q.altExchange:
+ print "--alternate-exchange=%s" % q._altExchange_.name,
print
def QueueListRecurse (self, filter):
diff --git a/specs/management-schema.xml b/specs/management-schema.xml
index c25aca67ed..6c00502ecb 100644
--- a/specs/management-schema.xml
+++ b/specs/management-schema.xml
@@ -129,10 +129,11 @@
<property name="vhostRef" type="objId" references="Vhost" access="RC" index="y" parentRef="y"/>
<property name="name" type="sstr" access="RC" index="y"/>
- <property name="durable" type="bool" access="RC"/>
- <property name="autoDelete" type="bool" access="RC"/>
- <property name="exclusive" type="bool" access="RC"/>
- <property name="arguments" type="map" access="RO" desc="Arguments supplied in queue.declare"/>
+ <property name="durable" type="bool" access="RC"/>
+ <property name="autoDelete" type="bool" access="RC"/>
+ <property name="exclusive" type="bool" access="RC"/>
+ <property name="arguments" type="map" access="RO" desc="Arguments supplied in queue.declare"/>
+ <property name="altExchange" type="objId" references="Exchange" access="RO" optional="y"/>
<statistic name="msgTotalEnqueues" type="count64" unit="message" desc="Total messages enqueued"/>
<statistic name="msgTotalDequeues" type="count64" unit="message" desc="Total messages dequeued"/>