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 2016/12/15 02:10:35 UTC

[1/5] activemq-artemis git commit: ARTEMIS-880 expand prefix support to consumers

Repository: activemq-artemis
Updated Branches:
  refs/heads/master c18ee8319 -> 88f4a8cce


ARTEMIS-880 expand prefix support to consumers


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

Branch: refs/heads/master
Commit: 29edd44d244f22423562630771608e20e22a9aa4
Parents: 3af1e5c
Author: jbertram <jb...@apache.org>
Authored: Wed Dec 14 15:08:32 2016 -0600
Committer: jbertram <jb...@apache.org>
Committed: Wed Dec 14 15:12:57 2016 -0600

----------------------------------------------------------------------
 .../core/server/impl/ServerSessionImpl.java     | 33 +++++++++++---------
 1 file changed, 19 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/29edd44d/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
index d622f5a..6d4c588 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
@@ -418,10 +418,12 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
                                         final boolean browseOnly,
                                         final boolean supportLargeMessage,
                                         final Integer credits) throws Exception {
-      Binding binding = postOffice.getBinding(queueName);
+      final SimpleString unPrefixedQueueName = removePrefix(queueName);
+
+      Binding binding = postOffice.getBinding(unPrefixedQueueName);
 
       if (binding == null || binding.getType() != BindingType.LOCAL_QUEUE) {
-         throw ActiveMQMessageBundle.BUNDLE.noSuchQueue(queueName);
+         throw ActiveMQMessageBundle.BUNDLE.noSuchQueue(unPrefixedQueueName);
       }
 
       SimpleString address = removePrefix(binding.getAddress());
@@ -429,13 +431,13 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
          try {
             securityCheck(address, CheckType.BROWSE, this);
          } catch (Exception e) {
-            securityCheck(address.concat(".").concat(queueName), CheckType.BROWSE, this);
+            securityCheck(address.concat(".").concat(unPrefixedQueueName), CheckType.BROWSE, this);
          }
       } else {
          try {
             securityCheck(address, CheckType.CONSUME, this);
          } catch (Exception e) {
-            securityCheck(address.concat(".").concat(queueName), CheckType.CONSUME, this);
+            securityCheck(address.concat(".").concat(unPrefixedQueueName), CheckType.CONSUME, this);
          }
       }
 
@@ -475,7 +477,7 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
          if (logger.isDebugEnabled()) {
             logger.debug("Session with user=" + username +
                             ", connection=" + this.remotingConnection +
-                            " created a consumer on queue " + queueName +
+                            " created a consumer on queue " + unPrefixedQueueName +
                             ", filter = " + filterString);
          }
 
@@ -528,6 +530,7 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
                             final int maxConsumers,
                             final boolean deleteOnNoConsumers,
                             final boolean autoCreated) throws Exception {
+      final SimpleString unPrefixedName = removePrefix(name);
 
       Pair<SimpleString, RoutingType> art = getAddressAndRoutingType(address, routingType);
 
@@ -540,7 +543,7 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
 
       server.checkQueueCreationLimit(getUsername());
 
-      Queue queue = server.createQueue(art.getA(), art.getB(), name, filterString, SimpleString.toSimpleString(getUsername()), durable, temporary, autoCreated, maxConsumers, deleteOnNoConsumers, server.getAddressSettingsRepository().getMatch(address.toString()).isAutoCreateAddresses());
+      Queue queue = server.createQueue(art.getA(), art.getB(), unPrefixedName, filterString, SimpleString.toSimpleString(getUsername()), durable, temporary, autoCreated, maxConsumers, deleteOnNoConsumers, server.getAddressSettingsRepository().getMatch(address.toString()).isAutoCreateAddresses());
 
       if (temporary) {
          // Temporary queue in core simply means the queue will be deleted if
@@ -549,7 +552,7 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
          // session is closed.
          // It is up to the user to delete the queue when finished with it
 
-         TempQueueCleanerUpper cleaner = new TempQueueCleanerUpper(server, name);
+         TempQueueCleanerUpper cleaner = new TempQueueCleanerUpper(server, unPrefixedName);
          if (remotingConnection instanceof TempQueueObserver) {
             cleaner.setObserver((TempQueueObserver) remotingConnection);
          }
@@ -557,11 +560,11 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
          remotingConnection.addCloseListener(cleaner);
          remotingConnection.addFailureListener(cleaner);
 
-         tempQueueCleannerUppers.put(name, cleaner);
+         tempQueueCleannerUppers.put(unPrefixedName, cleaner);
       }
 
       if (logger.isDebugEnabled()) {
-         logger.debug("Queue " + name + " created on address " + address +
+         logger.debug("Queue " + unPrefixedName + " created on address " + address +
                          " with filter=" + filterString + " temporary = " +
                          temporary + " durable=" + durable + " on session user=" + this.username + ", connection=" + this.remotingConnection);
       }
@@ -692,15 +695,17 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
 
    @Override
    public void deleteQueue(final SimpleString queueToDelete) throws Exception {
-      Binding binding = postOffice.getBinding(queueToDelete);
+      final SimpleString unPrefixedQueueName = removePrefix(queueToDelete);
+
+      Binding binding = postOffice.getBinding(unPrefixedQueueName);
 
       if (binding == null || binding.getType() != BindingType.LOCAL_QUEUE) {
          throw new ActiveMQNonExistentQueueException();
       }
 
-      server.destroyQueue(queueToDelete, this, true);
+      server.destroyQueue(unPrefixedQueueName, this, true);
 
-      TempQueueCleanerUpper cleaner = this.tempQueueCleannerUppers.remove(queueToDelete);
+      TempQueueCleanerUpper cleaner = this.tempQueueCleannerUppers.remove(unPrefixedQueueName);
 
       if (cleaner != null) {
          remotingConnection.removeCloseListener(cleaner);
@@ -711,12 +716,12 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
 
    @Override
    public QueueQueryResult executeQueueQuery(final SimpleString name) throws Exception {
-      return server.queueQuery(name);
+      return server.queueQuery(removePrefix(name));
    }
 
    @Override
    public AddressQueryResult executeAddressQuery(SimpleString name) throws Exception {
-      return server.addressQuery(name);
+      return server.addressQuery(removePrefix(name));
    }
 
    @Override


[2/5] activemq-artemis git commit: ARTEMIS-789 AMQP tests for routing semantics

Posted by cl...@apache.org.
ARTEMIS-789 AMQP tests for routing semantics


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

Branch: refs/heads/master
Commit: 3af1e5c734df3ac4d19b5e173f55a2a99fa33e8d
Parents: c18ee83
Author: jbertram <jb...@apache.org>
Authored: Wed Dec 14 09:30:43 2016 -0600
Committer: jbertram <jb...@apache.org>
Committed: Wed Dec 14 15:12:57 2016 -0600

----------------------------------------------------------------------
 .../artemis/tests/util/ActiveMQTestBase.java    |  4 +-
 .../integration/amqp/AmqpClientTestSupport.java |  9 +++
 .../integration/amqp/AmqpSendReceiveTest.java   | 73 ++++++++++++++++++--
 3 files changed, 78 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3af1e5c7/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java
index 7f01767..e6d68b1 100644
--- a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java
+++ b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java
@@ -418,10 +418,10 @@ public abstract class ActiveMQTestBase extends Assert {
    }
 
    protected Configuration createDefaultConfig(final int serverID, final boolean netty) throws Exception {
-      ConfigurationImpl configuration = createBasicConfig(serverID).setJMXManagementEnabled(false).addAcceptorConfiguration(new TransportConfiguration(INVM_ACCEPTOR_FACTORY, generateInVMParams(serverID)));
+      ConfigurationImpl configuration = createBasicConfig(serverID).setJMXManagementEnabled(false).addAcceptorConfiguration(new TransportConfiguration(INVM_ACCEPTOR_FACTORY, generateInVMParams(serverID), "invm"));
 
       if (netty) {
-         configuration.addAcceptorConfiguration(new TransportConfiguration(NETTY_ACCEPTOR_FACTORY));
+         configuration.addAcceptorConfiguration(new TransportConfiguration(NETTY_ACCEPTOR_FACTORY, new HashMap<String, Object>(), "netty", new HashMap<String, Object>()));
       }
 
       return configuration;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3af1e5c7/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpClientTestSupport.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpClientTestSupport.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpClientTestSupport.java
index 0d5c874..fde38fe 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpClientTestSupport.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpClientTestSupport.java
@@ -19,8 +19,10 @@ package org.apache.activemq.artemis.tests.integration.amqp;
 
 import java.net.URI;
 import java.util.LinkedList;
+import java.util.Set;
 
 import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.config.CoreAddressConfiguration;
 import org.apache.activemq.artemis.core.config.CoreQueueConfiguration;
@@ -105,6 +107,13 @@ public class AmqpClientTestSupport extends ActiveMQTestBase {
       serverConfig.addAddressConfiguration(address);
       serverConfig.getAddressesSettings().put("#", new AddressSettings().setAutoCreateQueues(true).setAutoCreateAddresses(true).setDeadLetterAddress(new SimpleString("ActiveMQ.DLQ")));
       serverConfig.setSecurityEnabled(false);
+      Set<TransportConfiguration> acceptors = serverConfig.getAcceptorConfigurations();
+      for (TransportConfiguration tc : acceptors) {
+         if (tc.getName().equals("netty")) {
+            tc.getExtraParams().put("anycastPrefix", "anycast://");
+            tc.getExtraParams().put("multicastPrefix", "multicast://");
+         }
+      }
       serverManager.start();
       server.start();
       return server;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3af1e5c7/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSendReceiveTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSendReceiveTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSendReceiveTest.java
index b817834..e102c77 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSendReceiveTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSendReceiveTest.java
@@ -16,11 +16,7 @@
  */
 package org.apache.activemq.artemis.tests.integration.amqp;
 
-import static org.apache.activemq.transport.amqp.AmqpSupport.JMS_SELECTOR_FILTER_IDS;
-import static org.apache.activemq.transport.amqp.AmqpSupport.NO_LOCAL_FILTER_IDS;
-import static org.apache.activemq.transport.amqp.AmqpSupport.findFilter;
-import static org.apache.activemq.transport.amqp.AmqpSupport.contains;
-
+import javax.jms.JMSException;
 import java.util.ArrayList;
 import java.util.LinkedList;
 import java.util.List;
@@ -30,7 +26,10 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.api.core.management.ActiveMQServerControl;
 import org.apache.activemq.artemis.core.server.Queue;
+import org.apache.activemq.artemis.core.server.RoutingType;
 import org.apache.activemq.artemis.protocol.amqp.proton.AmqpSupport;
 import org.apache.activemq.artemis.tests.util.Wait;
 import org.apache.activemq.transport.amqp.client.AmqpClient;
@@ -48,7 +47,10 @@ import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.jms.JMSException;
+import static org.apache.activemq.transport.amqp.AmqpSupport.JMS_SELECTOR_FILTER_IDS;
+import static org.apache.activemq.transport.amqp.AmqpSupport.NO_LOCAL_FILTER_IDS;
+import static org.apache.activemq.transport.amqp.AmqpSupport.contains;
+import static org.apache.activemq.transport.amqp.AmqpSupport.findFilter;
 
 /**
  * Test basic send and receive scenarios using only AMQP sender and receiver links.
@@ -178,6 +180,65 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport {
    }
 
    @Test(timeout = 60000)
+   public void testAnycastMessageRoutingExclusivity() throws Exception {
+      final String addressA = "addressA";
+      final String queueA = "queueA";
+      final String queueB = "queueB";
+      final String queueC = "queueC";
+
+      ActiveMQServerControl serverControl = server.getActiveMQServerControl();
+      serverControl.createAddress(addressA, RoutingType.ANYCAST.toString() + "," + RoutingType.MULTICAST.toString());
+      serverControl.createQueue(addressA, queueA, RoutingType.ANYCAST.toString());
+      serverControl.createQueue(addressA, queueB, RoutingType.ANYCAST.toString());
+      serverControl.createQueue(addressA, queueC, RoutingType.MULTICAST.toString());
+
+      sendMessages("anycast://" + addressA, 1);
+
+      assertEquals(1, server.locateQueue(SimpleString.toSimpleString(queueA)).getMessageCount() + server.locateQueue(SimpleString.toSimpleString(queueB)).getMessageCount());
+      assertEquals(0, server.locateQueue(SimpleString.toSimpleString(queueC)).getMessageCount());
+   }
+
+   @Test
+   public void testMulticastMessageRoutingExclusivity() throws Exception {
+      final String addressA = "addressA";
+      final String queueA = "queueA";
+      final String queueB = "queueB";
+      final String queueC = "queueC";
+
+      ActiveMQServerControl serverControl = server.getActiveMQServerControl();
+      serverControl.createAddress(addressA, RoutingType.ANYCAST.toString() + "," + RoutingType.MULTICAST.toString());
+      serverControl.createQueue(addressA, queueA, RoutingType.ANYCAST.toString());
+      serverControl.createQueue(addressA, queueB, RoutingType.MULTICAST.toString());
+      serverControl.createQueue(addressA, queueC, RoutingType.MULTICAST.toString());
+
+      sendMessages("multicast://" + addressA, 1);
+
+      assertEquals(0, server.locateQueue(SimpleString.toSimpleString(queueA)).getMessageCount());
+      assertEquals(2, server.locateQueue(SimpleString.toSimpleString(queueC)).getMessageCount() + server.locateQueue(SimpleString.toSimpleString(queueB)).getMessageCount());
+   }
+
+   @Test
+   public void testAmbiguousMessageRouting() throws Exception {
+      final String addressA = "addressA";
+      final String queueA = "queueA";
+      final String queueB = "queueB";
+      final String queueC = "queueC";
+      final String queueD = "queueD";
+
+      ActiveMQServerControl serverControl = server.getActiveMQServerControl();
+      serverControl.createAddress(addressA, RoutingType.ANYCAST.toString() + "," + RoutingType.MULTICAST.toString());
+      serverControl.createQueue(addressA, queueA, RoutingType.ANYCAST.toString());
+      serverControl.createQueue(addressA, queueB, RoutingType.ANYCAST.toString());
+      serverControl.createQueue(addressA, queueC, RoutingType.MULTICAST.toString());
+      serverControl.createQueue(addressA, queueD, RoutingType.MULTICAST.toString());
+
+      sendMessages(addressA, 1);
+
+      assertEquals(1, server.locateQueue(SimpleString.toSimpleString(queueA)).getMessageCount() + server.locateQueue(SimpleString.toSimpleString(queueB)).getMessageCount());
+      assertEquals(2, server.locateQueue(SimpleString.toSimpleString(queueC)).getMessageCount() + server.locateQueue(SimpleString.toSimpleString(queueD)).getMessageCount());
+   }
+
+   @Test(timeout = 60000)
    public void testTwoQueueReceiversOnSameConnectionReadMessagesNoDispositions() throws Exception {
       int MSG_COUNT = 4;
       sendMessages(getTestName(), MSG_COUNT);


[3/5] activemq-artemis git commit: ARTEMIS-789 fix AMQP SendingAndReceivingTest

Posted by cl...@apache.org.
ARTEMIS-789 fix AMQP SendingAndReceivingTest


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

Branch: refs/heads/master
Commit: 4424117d6534d452f9a883c428e1f5d911979724
Parents: 29edd44
Author: jbertram <jb...@apache.org>
Authored: Wed Dec 14 15:09:14 2016 -0600
Committer: jbertram <jb...@apache.org>
Committed: Wed Dec 14 15:13:23 2016 -0600

----------------------------------------------------------------------
 .../integration/amqp/SendingAndReceivingTest.java    | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/4424117d/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/SendingAndReceivingTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/SendingAndReceivingTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/SendingAndReceivingTest.java
index f424ea2..46e3b95 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/SendingAndReceivingTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/SendingAndReceivingTest.java
@@ -24,11 +24,10 @@ import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.TextMessage;
 import java.util.Random;
+import java.util.Set;
 
-import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.api.core.TransportConfiguration;
 import org.apache.activemq.artemis.core.server.ActiveMQServer;
-import org.apache.activemq.artemis.core.server.RoutingType;
-import org.apache.activemq.artemis.core.server.impl.AddressInfo;
 import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.apache.qpid.jms.JmsConnectionFactory;
 import org.junit.After;
@@ -45,7 +44,13 @@ public class SendingAndReceivingTest extends ActiveMQTestBase {
    public void setUp() throws Exception {
       super.setUp();
       server = createServer(true, true);
-      server.createAddressInfo(new AddressInfo(SimpleString.toSimpleString("exampleQueue"), RoutingType.ANYCAST));
+      Set<TransportConfiguration> acceptors = server.getConfiguration().getAcceptorConfigurations();
+      for (TransportConfiguration tc : acceptors) {
+         if (tc.getName().equals("netty")) {
+            tc.getExtraParams().put("anycastPrefix", "anycast://");
+            tc.getExtraParams().put("multicastPrefix", "multicast://");
+         }
+      }
       server.start();
    }
 
@@ -68,7 +73,7 @@ public class SendingAndReceivingTest extends ActiveMQTestBase {
       try {
          connection = connectionFactory.createConnection();
          Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-         Queue queue = session.createQueue("exampleQueue");
+         Queue queue = session.createQueue("anycast://exampleQueue");
          MessageProducer sender = session.createProducer(queue);
 
          String body = createMessage(10240);


[5/5] activemq-artemis git commit: This closes #920

Posted by cl...@apache.org.
This closes #920


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

Branch: refs/heads/master
Commit: 88f4a8ccec5ec843c250237d60b68ca56754d746
Parents: c18ee83 10a3248
Author: Clebert Suconic <cl...@apache.org>
Authored: Wed Dec 14 21:10:25 2016 -0500
Committer: Clebert Suconic <cl...@apache.org>
Committed: Wed Dec 14 21:10:25 2016 -0500

----------------------------------------------------------------------
 .../amqp/broker/AMQPSessionCallback.java        |  2 +-
 .../amqp/proton/ProtonServerSenderContext.java  |  4 +-
 .../core/server/impl/ServerSessionImpl.java     | 33 +++++----
 .../artemis/tests/util/ActiveMQTestBase.java    |  4 +-
 .../integration/amqp/AmqpClientTestSupport.java |  9 +++
 .../integration/amqp/AmqpSendReceiveTest.java   | 73 ++++++++++++++++++--
 .../amqp/SendingAndReceivingTest.java           | 15 ++--
 7 files changed, 110 insertions(+), 30 deletions(-)
----------------------------------------------------------------------



[4/5] activemq-artemis git commit: ARTEMIS-789 fix ArtemisTest

Posted by cl...@apache.org.
ARTEMIS-789 fix ArtemisTest


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

Branch: refs/heads/master
Commit: 10a32481fd277f033dce666ccf4d142164fdbee2
Parents: 4424117
Author: jbertram <jb...@apache.org>
Authored: Wed Dec 14 19:46:53 2016 -0600
Committer: jbertram <jb...@apache.org>
Committed: Wed Dec 14 19:46:53 2016 -0600

----------------------------------------------------------------------
 .../artemis/protocol/amqp/broker/AMQPSessionCallback.java        | 2 +-
 .../artemis/protocol/amqp/proton/ProtonServerSenderContext.java  | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/10a32481/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPSessionCallback.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPSessionCallback.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPSessionCallback.java
index 8f7584b..d8c908c 100644
--- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPSessionCallback.java
+++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPSessionCallback.java
@@ -239,7 +239,7 @@ public class AMQPSessionCallback implements SessionCallback {
       BindingQueryResult bindingQueryResult = serverSession.executeBindingQuery(SimpleString.toSimpleString(address));
       if (!bindingQueryResult.isExists() && bindingQueryResult.isAutoCreateQueues()) {
          try {
-            serverSession.createQueue(new SimpleString(address), new SimpleString(address), null, false, true);
+            serverSession.createQueue(new SimpleString(address), new SimpleString(address), RoutingType.ANYCAST, null, false, true);
          } catch (ActiveMQQueueExistsException e) {
             // The queue may have been created by another thread in the mean time.  Catch and do nothing.
          }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/10a32481/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonServerSenderContext.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonServerSenderContext.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonServerSenderContext.java
index 530d1b9..79f49bf 100644
--- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonServerSenderContext.java
+++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonServerSenderContext.java
@@ -251,9 +251,9 @@ public class ProtonServerSenderContext extends ProtonInitializable implements Pr
             Set<RoutingType> routingTypes = addressInfo.getRoutingTypes();
             //if the client defines 1 routing type and the broker another then throw an exception
             if (multicast && !routingTypes.contains(RoutingType.MULTICAST)) {
-               throw new ActiveMQAMQPIllegalStateException("Address is not configured for topic support");
+               throw new ActiveMQAMQPIllegalStateException("Address " + addressInfo.getName() + " is not configured for topic support");
             } else if (!multicast && !routingTypes.contains(RoutingType.ANYCAST)) {
-               throw new ActiveMQAMQPIllegalStateException("Address is not configured for queue support");
+               throw new ActiveMQAMQPIllegalStateException("Address " + addressInfo.getName() + " is not configured for queue support");
             }
          } else {
             //if not we look up the address