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/03/29 13:10:06 UTC
[1/2] activemq-artemis git commit: ARTEMIS-1082 Catch Create Queue
race in OpenWire
Repository: activemq-artemis
Updated Branches:
refs/heads/master 056a88dfc -> 9b11914c2
ARTEMIS-1082 Catch Create Queue race in OpenWire
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/955af96f
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/955af96f
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/955af96f
Branch: refs/heads/master
Commit: 955af96fe9e3d6a7fb518fb0161368306c2d0376
Parents: 056a88d
Author: Martyn Taylor <mt...@redhat.com>
Authored: Wed Mar 29 13:45:45 2017 +0100
Committer: Martyn Taylor <mt...@redhat.com>
Committed: Wed Mar 29 13:49:01 2017 +0100
----------------------------------------------------------------------
.../core/protocol/openwire/amq/AMQSession.java | 21 ++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/955af96f/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java
index 7a8ed3b..bd07251 100644
--- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java
+++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java
@@ -23,6 +23,7 @@ import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
+import org.apache.activemq.artemis.api.core.ActiveMQQueueExistsException;
import org.apache.activemq.artemis.api.core.RoutingType;
import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.core.paging.PagingStore;
@@ -176,16 +177,20 @@ public class AMQSession implements SessionCallback {
BindingQueryResult bindingQuery = server.bindingQuery(queueName);
QueueQueryResult queueBinding = server.queueQuery(queueName);
- boolean isAutoCreate = bindingQuery.isExists() ? true : bindingQuery.isAutoCreateQueues();
-
- if (!queueBinding.isExists()) {
- if (isAutoCreate) {
- server.createQueue(queueName, RoutingType.ANYCAST, queueName, null, true, isTemporary);
- connection.addKnownDestination(queueName);
- } else {
- hasQueue = false;
+ try {
+ if (!queueBinding.isExists()) {
+ if (bindingQuery.isAutoCreateQueues()) {
+ server.createQueue(queueName, RoutingType.ANYCAST, queueName, null, true, isTemporary);
+ connection.addKnownDestination(queueName);
+ } else {
+ hasQueue = false;
+ }
}
+ } catch (ActiveMQQueueExistsException e) {
+ // In case another thread created the queue before us but after we did the binding query
+ hasQueue = true;
}
+
}
return hasQueue;
}
[2/2] activemq-artemis git commit: This closes #1153
Posted by cl...@apache.org.
This closes #1153
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/9b11914c
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/9b11914c
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/9b11914c
Branch: refs/heads/master
Commit: 9b11914c21bba7bade682153877cb159fecafa85
Parents: 056a88d 955af96
Author: Clebert Suconic <cl...@apache.org>
Authored: Wed Mar 29 09:09:55 2017 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Wed Mar 29 09:09:55 2017 -0400
----------------------------------------------------------------------
.../core/protocol/openwire/amq/AMQSession.java | 21 ++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
----------------------------------------------------------------------