Author: rhs
Date: Thu Oct 30 14:12:27 2008
New Revision: 709244
URL: http://svn.apache.org/viewvc?rev=709244&view=rev
Log:
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
Modified:
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java
Modified:
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java?rev=709244&r1=709243&r2=709244&view=diff
==============================================================================
---
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java
(original)
+++
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java
Thu Oct 30 14:12:27 2008
@@ -40,8 +40,9 @@
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 @@
* 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 @@
_prefetchLow = prefetchLow;
_exclusive = exclusive;
- _synchronousQueue = new ArrayBlockingQueue(prefetchHigh, true);
+ _synchronousQueue = new LinkedBlockingQueue();
_autoClose = autoClose;
_noConsume = noConsume;