diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/SimpleAddressManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/SimpleAddressManager.java index e95dd112f1..b6b3a5c61a 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/SimpleAddressManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/SimpleAddressManager.java @@ -232,7 +232,7 @@ public class SimpleAddressManager implements AddressManager { @Override public AddressInfo updateAddressInfo(SimpleString addressName, Collection routingTypes) { - if (routingTypes == null) { + if (routingTypes == null || routingTypes.isEmpty()) { return this.addressInfoMap.get(addressName); } else { return this.addressInfoMap.computeIfPresent(addressName, (name, oldAddressInfo) -> { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressingTest.java index df5896ef89..14541fe0c4 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressingTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressingTest.java @@ -308,4 +308,13 @@ public class AddressingTest extends ActiveMQTestBase { session.createConsumer(q1.getName()); } } + + @Test + public void testEmptyRoutingTypes() throws Exception { + server.addOrUpdateAddressInfo(new AddressInfo(SimpleString.toSimpleString("xy"))); + server.stop(); + server.start(); + server.addOrUpdateAddressInfo(new AddressInfo(SimpleString.toSimpleString("xy"))); + server.stop(); + } }