Author: robbie
Date: Mon Mar 28 09:58:41 2011
New Revision: 1086168

URL: http://svn.apache.org/viewvc?rev=1086168&view=rev
Log:
QPID-3166: updates based on review feedback from Keith Wall

Modified:
    
qpid/branches/0.5.x-dev/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/MultipleTransactedBatchProducerTest.java

Modified: 
qpid/branches/0.5.x-dev/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/MultipleTransactedBatchProducerTest.java
URL: 
http://svn.apache.org/viewvc/qpid/branches/0.5.x-dev/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/MultipleTransactedBatchProducerTest.java?rev=1086168&r1=1086167&r2=1086168&view=diff
==============================================================================
--- 
qpid/branches/0.5.x-dev/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/MultipleTransactedBatchProducerTest.java
 (original)
+++ 
qpid/branches/0.5.x-dev/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/MultipleTransactedBatchProducerTest.java
 Mon Mar 28 09:58:41 2011
@@ -34,29 +34,6 @@ import javax.jms.Session;
 import org.apache.log4j.Logger;
 import org.apache.qpid.test.utils.QpidTestCase;
 
-/**
- * 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 QpidTestCase
 {
     private static final Logger _logger = 
Logger.getLogger(MultipleTransactedBatchProducerTest.class);
@@ -70,7 +47,7 @@ public class MultipleTransactedBatchProd
     private CountDownLatch _receivedLatch;
     private String _queueName;
 
-    private String _failMsg;
+    private transient String _failMsg;
 
     public void setUp() throws Exception
     {
@@ -83,6 +60,26 @@ public class MultipleTransactedBatchProd
         _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");
@@ -130,7 +127,6 @@ public class MultipleTransactedBatchProd
         assertNull("Test failed because: " + String.valueOf(_failMsg), 
_failMsg);
         assertTrue("Some of the messages were not all recieved in the given 
timeframe, remaining count was: "+_receivedLatch.getCount(),
                    result);
-
     }
 
     @Override
@@ -138,7 +134,9 @@ public class MultipleTransactedBatchProd
     {
         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)
         {



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to