ARTEMIS-3438 legacy updateQueue doesn't respect ringSize

This commit is contained in:
Justin Bertram 2021-08-20 12:56:22 -05:00 committed by Clebert Suconic
parent eb73709a1a
commit 3fd0eea667
2 changed files with 32 additions and 1 deletions

View File

@ -1392,7 +1392,7 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
clearIO(); clearIO();
try { 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 (queue == null) {
if (AuditLogger.isResourceLoggingEnabled()) { if (AuditLogger.isResourceLoggingEnabled()) {
AuditLogger.updateQueueFailure(name, routingType); AuditLogger.updateQueueFailure(name, routingType);

View File

@ -663,6 +663,37 @@ public class ActiveMQServerControlTest extends ManagementTestBase {
serverControl.destroyQueue(name.toString()); 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 @Test
public void testGetQueueCount() throws Exception { public void testGetQueueCount() throws Exception {
SimpleString address = RandomUtil.randomSimpleString(); SimpleString address = RandomUtil.randomSimpleString();