From ec7e6d7ea76382ba8a405155bf1c71b28cc34f28 Mon Sep 17 00:00:00 2001 From: Andy Taylor Date: Tue, 28 Mar 2017 10:40:45 +0100 Subject: [PATCH] ARTEMIS-1075 - Add Routing Type to QueueControl management API https://issues.apache.org/jira/browse/ARTEMIS-1075 --- .../artemis/api/core/management/QueueControl.java | 6 ++++++ .../core/management/impl/QueueControlImpl.java | 13 +++++++++++++ .../management/QueueControlUsingCoreTest.java | 5 +++++ 3 files changed, 24 insertions(+) diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/QueueControl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/QueueControl.java index ac207982b2..11c98ad766 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/QueueControl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/QueueControl.java @@ -56,6 +56,12 @@ public interface QueueControl { @Attribute(desc = "whether this queue is durable") boolean isDurable(); + /** + * The routing type of this queue. + */ + @Attribute(desc = "The routing type of this queue") + byte getRoutingType() throws Exception; + /** * Returns the filter associated with this queue. */ diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java index c5f2111422..f96556198e 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java @@ -175,6 +175,19 @@ public class QueueControlImpl extends AbstractControl implements QueueControl { } } + @Override + public byte getRoutingType() throws Exception { + checkStarted(); + + clearIO(); + try { + return queue.getRoutingType().getType(); + } finally { + blockOnIO(); + } + + } + @Override public boolean isTemporary() { checkStarted(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlUsingCoreTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlUsingCoreTest.java index a389d6518d..e96b5cb2b7 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlUsingCoreTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/QueueControlUsingCoreTest.java @@ -171,6 +171,11 @@ public class QueueControlUsingCoreTest extends QueueControlTest { return (Boolean) proxy.retrieveAttributeValue("durable"); } + @Override + public byte getRoutingType() throws Exception { + return (byte) proxy.retrieveAttributeValue("routingType"); + } + @Override public boolean isTemporary() { return (Boolean) proxy.retrieveAttributeValue("temporary");