You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2017/09/13 22:30:59 UTC

[1/2] activemq-artemis git commit: This closes #1531

Repository: activemq-artemis
Updated Branches:
  refs/heads/master 01134e234 -> 621a62fcb


This closes #1531


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

Branch: refs/heads/master
Commit: 621a62fcb53999b01a171d7fd478436e0ceb2f6f
Parents: 01134e2 342cc83
Author: Clebert Suconic <cl...@apache.org>
Authored: Wed Sep 13 18:27:39 2017 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Wed Sep 13 18:27:39 2017 -0400

----------------------------------------------------------------------
 .../core/protocol/openwire/amq/AMQConsumer.java | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)
----------------------------------------------------------------------



[2/2] activemq-artemis git commit: ARTEMIS-1410 remove redundant code processing openwire destination

Posted by cl...@apache.org.
ARTEMIS-1410 remove redundant code processing openwire destination

Remove some redundant code in the processing of the OpenWire Destination
name, both in the topic handler and in the method in general the
destination name only needs to be converted once and only one
SimpleString instance needs to be created from that which will then feed
all the places that either the String form or the SimpleString form of
the result is needed.

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

Branch: refs/heads/master
Commit: 342cc83ea44205483fa33ba9375c40a860535032
Parents: 01134e2
Author: Timothy Bish <ta...@gmail.com>
Authored: Tue Sep 12 17:41:25 2017 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Wed Sep 13 18:27:39 2017 -0400

----------------------------------------------------------------------
 .../core/protocol/openwire/amq/AMQConsumer.java | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/342cc83e/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java
index 010a7aa..969d9ae 100644
--- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java
+++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java
@@ -99,33 +99,24 @@ public class AMQConsumer {
          }
       }
 
-      String physicalName = session.convertWildcard(openwireDestination.getPhysicalName());
-
-      SimpleString address;
+      SimpleString destinationName = new SimpleString(session.convertWildcard(openwireDestination.getPhysicalName()));
 
       if (openwireDestination.isTopic()) {
-         if (openwireDestination.isTemporary()) {
-            address = new SimpleString(physicalName);
-         } else {
-            address = new SimpleString(physicalName);
-         }
-
-         SimpleString queueName = createTopicSubscription(info.isDurable(), info.getClientId(), physicalName, info.getSubscriptionName(), selector, address);
+         SimpleString queueName = createTopicSubscription(info.isDurable(), info.getClientId(), destinationName.toString(), info.getSubscriptionName(), selector, destinationName);
 
          serverConsumer = session.getCoreSession().createConsumer(nativeId, queueName, null, info.isBrowser(), false, -1);
          serverConsumer.setlowConsumerDetection(slowConsumerDetectionListener);
          //only advisory topic consumers need this.
          ((ServerConsumerImpl)serverConsumer).setPreAcknowledge(preAck);
       } else {
-         SimpleString queueName = new SimpleString(session.convertWildcard(openwireDestination.getPhysicalName()));
          try {
-            session.getCoreServer().createQueue(queueName, RoutingType.ANYCAST, queueName, null, true, false);
+            session.getCoreServer().createQueue(destinationName, RoutingType.ANYCAST, destinationName, null, true, false);
          } catch (ActiveMQQueueExistsException e) {
             // ignore
          }
-         serverConsumer = session.getCoreSession().createConsumer(nativeId, queueName, selector, info.isBrowser(), false, -1);
+         serverConsumer = session.getCoreSession().createConsumer(nativeId, destinationName, selector, info.isBrowser(), false, -1);
          serverConsumer.setlowConsumerDetection(slowConsumerDetectionListener);
-         AddressSettings addrSettings = session.getCoreServer().getAddressSettingsRepository().getMatch(queueName.toString());
+         AddressSettings addrSettings = session.getCoreServer().getAddressSettingsRepository().getMatch(destinationName.toString());
          if (addrSettings != null) {
             //see PolicyEntry
             if (info.getPrefetchSize() != 0 && addrSettings.getQueuePrefetch() == 0) {
@@ -136,7 +127,6 @@ public class AMQConsumer {
                session.getConnection().dispatch(cc);
             }
          }
-
       }
 
       serverConsumer.setProtocolData(this);