diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java index 145a23ad75..3e1a994573 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java @@ -1392,7 +1392,7 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active clearIO(); try { - final Queue queue = server.updateQueue(name, routingType != null ? RoutingType.valueOf(routingType) : null, filter, maxConsumers, purgeOnNoConsumers, exclusive, groupRebalance, groupBuckets, groupFirstKey, nonDestructive, consumersBeforeDispatch, delayBeforeDispatch, user); + final Queue queue = server.updateQueue(name, routingType != null ? RoutingType.valueOf(routingType) : null, filter, maxConsumers, purgeOnNoConsumers, exclusive, groupRebalance, groupBuckets, groupFirstKey, nonDestructive, consumersBeforeDispatch, delayBeforeDispatch, user, ringSize); if (queue == null) { if (AuditLogger.isResourceLoggingEnabled()) { AuditLogger.updateQueueFailure(name, routingType); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java index 1e1057508f..24c753108b 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java @@ -663,6 +663,37 @@ public class ActiveMQServerControlTest extends ManagementTestBase { serverControl.destroyQueue(name.toString()); } + @Test + public void testCreateAndLegacyUpdateQueueRingSize() throws Exception { + SimpleString address = RandomUtil.randomSimpleString(); + SimpleString name = RandomUtil.randomSimpleString(); + + ActiveMQServerControl serverControl = createManagementControl(); + + serverControl.createQueue(new QueueConfiguration(name).setAddress(address).setRoutingType(RoutingType.ANYCAST).setAutoCreateAddress(true).toJSON()); + serverControl.updateQueue(name.toString(), + RoutingType.ANYCAST.toString(), + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + 101L); + + QueueControl queueControl = ManagementControlHelper.createQueueControl(address, name, RoutingType.ANYCAST, mbeanServer); + Assert.assertEquals(address.toString(), queueControl.getAddress()); + Assert.assertEquals(name.toString(), queueControl.getName()); + Assert.assertEquals(101, queueControl.getRingSize()); + + serverControl.destroyQueue(name.toString()); + } + @Test public void testGetQueueCount() throws Exception { SimpleString address = RandomUtil.randomSimpleString();