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/09/15 15:20:32 UTC

[1/2] activemq-artemis git commit: Add back autoCreate for bindingsQuery in AMQP protocol

Repository: activemq-artemis
Updated Branches:
  refs/heads/master 646a89198 -> adeaa66a1


Add back autoCreate for bindingsQuery in AMQP protocol


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

Branch: refs/heads/master
Commit: dd32d6bb3e253992aaebe9e8652219e7f13a4d88
Parents: 646a891
Author: Martyn Taylor <mt...@redhat.com>
Authored: Wed Sep 14 11:20:32 2016 +0100
Committer: Clebert Suconic <cl...@apache.org>
Committed: Thu Sep 15 11:17:26 2016 -0400

----------------------------------------------------------------------
 .../plug/ProtonSessionIntegrationCallback.java       | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/dd32d6bb/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/plug/ProtonSessionIntegrationCallback.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/plug/ProtonSessionIntegrationCallback.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/plug/ProtonSessionIntegrationCallback.java
index 8986aba..153d033 100644
--- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/plug/ProtonSessionIntegrationCallback.java
+++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/proton/plug/ProtonSessionIntegrationCallback.java
@@ -214,19 +214,28 @@ public class ProtonSessionIntegrationCallback implements AMQPSessionCallback, Se
       if (!queueQueryResult.isExists() && queueQueryResult.isAutoCreateJmsQueues() && autoCreate) {
          try {
             serverSession.createQueue(new SimpleString(queueName), new SimpleString(queueName), null, false, true);
-            queueQueryResult = new QueueQueryResult(queueQueryResult.getName(), queueQueryResult.getAddress(), queueQueryResult.isDurable(), queueQueryResult.isTemporary(), queueQueryResult.getFilterString(), queueQueryResult.getConsumerCount(), queueQueryResult.getMessageCount(), queueQueryResult.isAutoCreateJmsQueues(), true);
          }
          catch (ActiveMQQueueExistsException e) {
             // The queue may have been created by another thread in the mean time.  Catch and do nothing.
          }
+         queueQueryResult = new QueueQueryResult(queueQueryResult.getName(), queueQueryResult.getAddress(), queueQueryResult.isDurable(), queueQueryResult.isTemporary(), queueQueryResult.getFilterString(), queueQueryResult.getConsumerCount(), queueQueryResult.getMessageCount(), queueQueryResult.isAutoCreateJmsQueues(), true);
       }
       return queueQueryResult;
    }
 
    @Override
    public boolean bindingQuery(String address) throws Exception {
-      BindingQueryResult queueQuery = serverSession.executeBindingQuery(SimpleString.toSimpleString(address));
-      return queueQuery.isExists();
+      BindingQueryResult bindingQueryResult = serverSession.executeBindingQuery(SimpleString.toSimpleString(address));
+      if (!bindingQueryResult.isExists() && bindingQueryResult.isAutoCreateJmsQueues()) {
+         try {
+            serverSession.createQueue(new SimpleString(address), new SimpleString(address), null, false, true);
+         }
+         catch (ActiveMQQueueExistsException e) {
+            // The queue may have been created by another thread in the mean time.  Catch and do nothing.
+         }
+         bindingQueryResult = serverSession.executeBindingQuery(SimpleString.toSimpleString(address));
+      }
+      return bindingQueryResult.isExists();
    }
 
    @Override


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

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


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

Branch: refs/heads/master
Commit: adeaa66a1b730ff522d5cbb14a441b94e72464d1
Parents: 646a891 dd32d6b
Author: Clebert Suconic <cl...@apache.org>
Authored: Thu Sep 15 11:17:27 2016 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Thu Sep 15 11:17:27 2016 -0400

----------------------------------------------------------------------
 .../plug/ProtonSessionIntegrationCallback.java       | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------