From b5d8000313ed57d468534c7da595a1f7299f3140 Mon Sep 17 00:00:00 2001 From: "Rafael H. Schloming" Date: Thu, 30 Oct 2008 21:12:27 +0000 Subject: 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/qpid@709244 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/org/apache/qpid/client/BasicMessageConsumer.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'java/client') diff --git a/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java b/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java index dfd228370c..76422c6297 100644 --- a/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java +++ b/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 extends Closeable implements Messa * Used in the blocking receive methods to receive a message from the Session thread.

Or to notify of errors *

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 extends Closeable implements Messa _prefetchLow = prefetchLow; _exclusive = exclusive; - _synchronousQueue = new ArrayBlockingQueue(prefetchHigh, true); + _synchronousQueue = new LinkedBlockingQueue(); _autoClose = autoClose; _noConsume = noConsume; -- cgit v1.2.1