summaryrefslogtreecommitdiff
path: root/qpid/java
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2008-10-30 21:12:27 +0000
committerRafael H. Schloming <rhs@apache.org>2008-10-30 21:12:27 +0000
commit63a45cc51536c9498b6cf72f6dc6937a4b9ac4d6 (patch)
treef3e7987b521d2235425f02a96aadb860cbb74ca7 /qpid/java
parent435a67ed93fd1aedc0aa151c1a268862d1e1b073 (diff)
downloadqpid-python-63a45cc51536c9498b6cf72f6dc6937a4b9ac4d6.tar.gz
QPID-1420: swapped out the size limited ArrayBlockingQueue with a LinkedBlockingQueue, this eliminates the need to coordinate the size of the synchronousQueue with the max prefetch, and hopefully prevents the deadlock described in the JIRA
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@709244 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java')
-rw-r--r--qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java b/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java
index dfd228370c..76422c6297 100644
--- a/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java
+++ b/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java
@@ -40,8 +40,9 @@ import java.util.SortedSet;
import java.util.ArrayList;
import java.util.Collections;
import java.util.TreeSet;
-import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ConcurrentLinkedQueue;
+import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
@@ -78,7 +79,7 @@ public abstract class BasicMessageConsumer<U> extends Closeable implements Messa
* Used in the blocking receive methods to receive a message from the Session thread. <p/> Or to notify of errors
* <p/> Argument true indicates we want strict FIFO semantics
*/
- protected final ArrayBlockingQueue _synchronousQueue;
+ protected final BlockingQueue _synchronousQueue;
protected final MessageFactoryRegistry _messageFactory;
@@ -182,7 +183,7 @@ public abstract class BasicMessageConsumer<U> extends Closeable implements Messa
_prefetchLow = prefetchLow;
_exclusive = exclusive;
- _synchronousQueue = new ArrayBlockingQueue(prefetchHigh, true);
+ _synchronousQueue = new LinkedBlockingQueue();
_autoClose = autoClose;
_noConsume = noConsume;