activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbert...@apache.org
Subject [2/2] activemq-artemis git commit: NO-JIRA Fix Issue with Auto Create Address
Date Fri, 16 Dec 2016 15:07:49 GMT
NO-JIRA Fix Issue with Auto Create Address


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

Branch: refs/heads/master
Commit: 3e0ad2268b35501413eeabc0b6ae11d4bf90e810
Parents: be38f4d
Author: Martyn Taylor <mtaylor@redhat.com>
Authored: Fri Dec 16 14:52:24 2016 +0000
Committer: jbertram <jbertram@apache.org>
Committed: Fri Dec 16 09:06:59 2016 -0600

----------------------------------------------------------------------
 .../artemis/core/server/impl/ActiveMQServerImpl.java  | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3e0ad226/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
index bfe57e3..fb7d604 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
@@ -2531,10 +2531,16 @@ public class ActiveMQServerImpl implements ActiveMQServer {
       AddressInfo info = postOffice.getAddressInfo(addressName);
 
       if (autoCreateAddress) {
-         if (info == null || !info.getRoutingTypes().contains(routingType)) {
-            final AddressInfo defaultAddressInfo = new AddressInfo(addressName);
-            defaultAddressInfo.addRoutingType(routingType == null ? ActiveMQDefaultConfiguration.getDefaultRoutingType()
: routingType);
-            createOrUpdateAddressInfo(defaultAddressInfo.setAutoCreated(true));
+         RoutingType rt = (routingType == null ? ActiveMQDefaultConfiguration.getDefaultRoutingType()
: routingType);
+         if (info == null) {
+            final AddressInfo addressInfo = new AddressInfo(addressName, rt);
+            createAddressInfo(addressInfo);
+         }
+         else if (!info.getRoutingTypes().contains(routingType)) {
+            Set<RoutingType> routingTypes = new HashSet<>();
+            routingTypes.addAll(info.getRoutingTypes());
+            routingTypes.add(routingType);
+            updateAddressInfo(info.getName().toString(), routingTypes);
          }
       } else if (info == null) {
          throw ActiveMQMessageBundle.BUNDLE.addressDoesNotExist(addressName);


Mime
View raw message