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

View File

@ -567,6 +567,25 @@ public class ActiveMQServerControlTest extends ManagementTestBase {
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
public void testGetQueueNames() throws Exception {
SimpleString address = RandomUtil.randomSimpleString();