activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [1/2] activemq-artemis git commit: ARTEMIS-1137 handle empty routing type on restart
Date Tue, 02 May 2017 15:38:20 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master e22f77d8c -> c1df97de6


ARTEMIS-1137 handle empty routing type on restart


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/578c0fab
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/578c0fab
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/578c0fab

Branch: refs/heads/master
Commit: 578c0fabb2c4edaa3fc28919357a937d5192cac2
Parents: e22f77d
Author: Justin Bertram <jbertram@apache.org>
Authored: Tue May 2 10:04:24 2017 -0500
Committer: Justin Bertram <jbertram@apache.org>
Committed: Tue May 2 10:06:42 2017 -0500

----------------------------------------------------------------------
 .../artemis/core/postoffice/impl/SimpleAddressManager.java  | 2 +-
 .../tests/integration/addressing/AddressingTest.java        | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/578c0fab/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/SimpleAddressManager.java
----------------------------------------------------------------------
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 e95dd11..b6b3a5c 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<RoutingType> routingTypes) {
-      if (routingTypes == null) {
+      if (routingTypes == null || routingTypes.isEmpty()) {
          return this.addressInfoMap.get(addressName);
       } else {
          return this.addressInfoMap.computeIfPresent(addressName, (name, oldAddressInfo)
-> {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/578c0fab/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/addressing/AddressingTest.java
----------------------------------------------------------------------
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 df5896e..14541fe 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();
+   }
 }


Mime
View raw message