This commit is contained in:
Michael Andre Pearce 2020-06-23 09:36:50 +01:00
commit 18acd5f8d4
2 changed files with 21 additions and 2 deletions

View File

@ -3954,7 +3954,7 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
.setAddress(address) .setAddress(address)
.setId(id) .setId(id)
.setRoutingType(routingType) .setRoutingType(routingType)
.setFilterString(filter.getFilterString()) .setFilterString(filter == null ? null : filter.getFilterString())
.setDurable(isDurable()) .setDurable(isDurable())
.setUser(user) .setUser(user)
.setMaxConsumers(maxConsumers) .setMaxConsumers(maxConsumers)
@ -3963,7 +3963,7 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
.setGroupBuckets(groupBuckets) .setGroupBuckets(groupBuckets)
.setGroupFirstKey(groupFirstKey) .setGroupFirstKey(groupFirstKey)
.setLastValue(false) .setLastValue(false)
.setLastValue(null) .setLastValueKey((String) null)
.setNonDestructive(nonDestructive) .setNonDestructive(nonDestructive)
.setPurgeOnNoConsumers(purgeOnNoConsumers) .setPurgeOnNoConsumers(purgeOnNoConsumers)
.setConsumersBeforeDispatch(consumersBeforeDispatch) .setConsumersBeforeDispatch(consumersBeforeDispatch)

View File

@ -567,6 +567,25 @@ public class ActiveMQServerControlTest extends ManagementTestBase {
checkNoResource(ObjectNameBuilder.DEFAULT.getQueueObjectName(address, name, RoutingType.ANYCAST)); checkNoResource(ObjectNameBuilder.DEFAULT.getQueueObjectName(address, name, RoutingType.ANYCAST));
} }
@Test
public void testCreateAndUpdateQueueWithoutFilter() 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).setFilterString((String) null).toJSON());
serverControl.updateQueue(new QueueConfiguration(name).setAddress(address).setRoutingType(RoutingType.ANYCAST).setMaxConsumers(1).toJSON());
QueueControl queueControl = ManagementControlHelper.createQueueControl(address, name, RoutingType.ANYCAST, mbeanServer);
Assert.assertEquals(address.toString(), queueControl.getAddress());
Assert.assertEquals(name.toString(), queueControl.getName());
Assert.assertNull(queueControl.getFilter());
Assert.assertEquals(1, queueControl.getMaxConsumers());
serverControl.destroyQueue(name.toString());
}
@Test @Test
public void testGetQueueNames() throws Exception { public void testGetQueueNames() throws Exception {
SimpleString address = RandomUtil.randomSimpleString(); SimpleString address = RandomUtil.randomSimpleString();