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-918 - use requested routing type when client defined with amqp and address doesnt exist
Date Thu, 12 Jan 2017 17:22:25 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master a5f21fa6a -> c441625e5


ARTEMIS-918 - use requested routing type when client defined with amqp and address doesnt
exist

https://issues.apache.org/jira/browse/ARTEMIS-918


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

Branch: refs/heads/master
Commit: f52cb5c610a0d15e924d4c36b0741414df1487d6
Parents: a5f21fa
Author: Andy Taylor <andy.tayls67@gmail.com>
Authored: Thu Jan 12 12:07:10 2017 +0000
Committer: Andy Taylor <andy.tayls67@gmail.com>
Committed: Thu Jan 12 12:07:16 2017 +0000

----------------------------------------------------------------------
 .../amqp/proton/ProtonServerSenderContext.java    |  2 +-
 .../amqp/ClientDefinedMultiConsumerTest.java      | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f52cb5c6/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 d287417..8d42fe9 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
@@ -246,7 +246,7 @@ public class ProtonServerSenderContext extends ProtonInitializable implements
Pr
          boolean clientDefined = hasCapabilities(TOPIC, source) || hasCapabilities(QUEUE,
source);
          if (clientDefined)  {
             multicast = hasCapabilities(TOPIC, source);
-            AddressQueryResult addressQueryResult = sessionSPI.addressQuery(addressToUse.toString(),
defaultRoutingType, true);
+            AddressQueryResult addressQueryResult = sessionSPI.addressQuery(addressToUse.toString(),
multicast ? RoutingType.MULTICAST : RoutingType.ANYCAST, true);
             if (!addressQueryResult.isExists()) {
                throw ActiveMQAMQPProtocolMessageBundle.BUNDLE.sourceAddressDoesntExist();
             }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/f52cb5c6/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ClientDefinedMultiConsumerTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ClientDefinedMultiConsumerTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ClientDefinedMultiConsumerTest.java
index 9b5187f..f4643f0 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ClientDefinedMultiConsumerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ClientDefinedMultiConsumerTest.java
@@ -301,6 +301,24 @@ public class ClientDefinedMultiConsumerTest extends AmqpClientTestSupport
 {
       connection.close();
    }
 
+   @Test(timeout = 60000)
+   public void testAddressDoesntExist() throws Exception {
+      AmqpClient client = createAmqpClient();
+
+      AmqpConnection connection = addConnection(client.connect("myClientId"));
+      AmqpSession session = connection.createSession();
+      Source source = createNonSharedSource(TerminusDurability.CONFIGURATION);
+      Source source1 = createSharedSource(TerminusDurability.CONFIGURATION);
+      AmqpReceiver receiver = session.createMulticastReceiver(source, "myReceiverID", "mySub");
+      try {
+         session.createMulticastReceiver(source1, "myReceiverID", "mySub|2");
+         fail("Exception expected");
+      } catch (Exception e) {
+         //expected
+      }
+      connection.close();
+   }
+
    private Source createNonSharedSource(TerminusDurability terminusDurability) {
       Source source = new Source();
       source.setAddress(address.toString());


Mime
View raw message