This commit is contained in:
Clebert Suconic 2021-08-20 17:00:23 -04:00
commit cc1b7f7f5a
2 changed files with 32 additions and 1 deletions

View File

@ -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);

View File

@ -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();