diff options
author | Robert Gemmell <robbie@apache.org> | 2011-03-28 09:58:51 +0000 |
---|---|---|
committer | Robert Gemmell <robbie@apache.org> | 2011-03-28 09:58:51 +0000 |
commit | 72e229d71e99923fa25317aec24996017c04016c (patch) | |
tree | 4daf36a5d0c8fbd432aa9a6740c93034df68dfa6 /java/systests | |
parent | 646f6caf446e227e9d32ae04068cb1e058f69cca (diff) | |
download | qpid-python-72e229d71e99923fa25317aec24996017c04016c.tar.gz |
QPID-3166: updates based on review feedback from Keith Wall
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1086169 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/systests')
-rw-r--r-- | java/systests/src/main/java/org/apache/qpid/server/queue/MultipleTransactedBatchProducerTest.java | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/java/systests/src/main/java/org/apache/qpid/server/queue/MultipleTransactedBatchProducerTest.java b/java/systests/src/main/java/org/apache/qpid/server/queue/MultipleTransactedBatchProducerTest.java index 5ba09a3848..460270e188 100644 --- a/java/systests/src/main/java/org/apache/qpid/server/queue/MultipleTransactedBatchProducerTest.java +++ b/java/systests/src/main/java/org/apache/qpid/server/queue/MultipleTransactedBatchProducerTest.java @@ -34,29 +34,6 @@ import javax.jms.Session; import org.apache.log4j.Logger; import org.apache.qpid.test.utils.QpidBrokerTestCase; -/** - * MultipleTransactedBatchProducerTest - * - * Summary: - * When there are multiple producers submitting batches of messages to a given - * queue using transacted sessions, it is highly probable that concurrent - * enqueue() activity will occur and attempt delivery of their message to the - * same subscription. In this scenario it is likely that one of the attempts - * will succeed and the other will result in use of the deliverAsync() method - * to start a queue Runner and ensure delivery of the message. - * - * A defect within the processQueue() method used by the Runner would mean that - * delivery of these messages may not occur, should the Runner stop before all - * messages have been processed. Such a defect was discovered and found to be - * most visible when Selectors are used such that one and only one subscription - * can/will accept any given message, but multiple subscriptions are present, - * and one of the earlier subscriptions receives more messages than the others. - * - * This test is to validate that the processQueue() method is able to correctly - * deliver all of the messages present for asynchronous delivery to subscriptions, - * by utilising multiple batch transacted producers to create the scenario and - * ensure all messages are received by a consumer. - */ public class MultipleTransactedBatchProducerTest extends QpidBrokerTestCase { private static final Logger _logger = Logger.getLogger(MultipleTransactedBatchProducerTest.class); @@ -70,7 +47,7 @@ public class MultipleTransactedBatchProducerTest extends QpidBrokerTestCase private CountDownLatch _receivedLatch; private String _queueName; - private String _failMsg; + private volatile String _failMsg; public void setUp() throws Exception { @@ -83,6 +60,26 @@ public class MultipleTransactedBatchProducerTest extends QpidBrokerTestCase _failMsg = null; } + /** + * When there are multiple producers submitting batches of messages to a given + * queue using transacted sessions, it is highly probable that concurrent + * enqueue() activity will occur and attempt delivery of their message to the + * same subscription. In this scenario it is likely that one of the attempts + * will succeed and the other will result in use of the deliverAsync() method + * to start a queue Runner and ensure delivery of the message. + * + * A defect within the processQueue() method used by the Runner would mean that + * delivery of these messages may not occur, should the Runner stop before all + * messages have been processed. Such a defect was discovered and found to be + * most visible when Selectors are used such that one and only one subscription + * can/will accept any given message, but multiple subscriptions are present, + * and one of the earlier subscriptions receives more messages than the others. + * + * This test is to validate that the processQueue() method is able to correctly + * deliver all of the messages present for asynchronous delivery to subscriptions, + * by utilising multiple batch transacted producers to create the scenario and + * ensure all messages are received by a consumer. + */ public void testMultipleBatchedProducersWithMultipleConsumersUsingSelectors() throws Exception { String selector1 = ("(\"" + _queueName +"\" % " + NUM_CONSUMERS + ") = 0"); @@ -138,7 +135,9 @@ public class MultipleTransactedBatchProducerTest extends QpidBrokerTestCase { Message message = super.createNextMessage(session,msgCount); - //bias at least 50% of the messages to the first consumers selector + //bias at least 50% of the messages to the first consumers selector because + //the issue presents itself primarily when an earlier subscription completes + //delivery after the later subscriptions int val; if (msgCount % 2 == 0) { |