activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r918966 - in /activemq/branches/activemq-5.3/activemq-core/src: main/java/org/apache/activemq/ActiveMQMessageConsumer.java test/java/org/apache/activemq/usecases/TopicRedeliverTest.java
Date Thu, 04 Mar 2010 12:31:02 GMT
Author: gtully
Date: Thu Mar  4 12:31:01 2010
New Revision: 918966

URL: http://svn.apache.org/viewvc?rev=918966&view=rev
Log:
undo additional tests committed in error with r918386

Modified:
    activemq/branches/activemq-5.3/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
    activemq/branches/activemq-5.3/activemq-core/src/test/java/org/apache/activemq/usecases/TopicRedeliverTest.java

Modified: activemq/branches/activemq-5.3/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
URL: http://svn.apache.org/viewvc/activemq/branches/activemq-5.3/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java?rev=918966&r1=918965&r2=918966&view=diff
==============================================================================
--- activemq/branches/activemq-5.3/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
(original)
+++ activemq/branches/activemq-5.3/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
Thu Mar  4 12:31:01 2010
@@ -1207,7 +1207,6 @@
                             } catch (RuntimeException e) {
                                 if (isAutoAcknowledgeBatch() || isAutoAcknowledgeEach() ||
session.isIndividualAcknowledge()) {
                                     // Redeliver the message
-                                    unconsumedMessages.enqueueFirst(md);
                                 } else {
                                     // Transacted or Client ack: Deliver the
                                     // next message.

Modified: activemq/branches/activemq-5.3/activemq-core/src/test/java/org/apache/activemq/usecases/TopicRedeliverTest.java
URL: http://svn.apache.org/viewvc/activemq/branches/activemq-5.3/activemq-core/src/test/java/org/apache/activemq/usecases/TopicRedeliverTest.java?rev=918966&r1=918965&r2=918966&view=diff
==============================================================================
--- activemq/branches/activemq-5.3/activemq-core/src/test/java/org/apache/activemq/usecases/TopicRedeliverTest.java
(original)
+++ activemq/branches/activemq-5.3/activemq-core/src/test/java/org/apache/activemq/usecases/TopicRedeliverTest.java
Thu Mar  4 12:31:01 2010
@@ -16,34 +16,24 @@
  */
 package org.apache.activemq.usecases;
 
-import java.util.ArrayList;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-
 import javax.jms.Connection;
 import javax.jms.DeliveryMode;
 import javax.jms.Destination;
 import javax.jms.Message;
 import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
 import javax.jms.MessageProducer;
 import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.jms.Topic;
 
-import org.apache.activemq.memory.list.MessageList;
 import org.apache.activemq.test.TestSupport;
 import org.apache.activemq.util.IdGenerator;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 
 /**
  * @version $Revision: 1.1.1.1 $
  */
 public class TopicRedeliverTest extends TestSupport {
 
-    private static final Log LOG = LogFactory.getLog(TopicRedeliverTest.class);
     private static final int RECEIVE_TIMEOUT = 10000;
 
     protected int deliveryMode = DeliveryMode.PERSISTENT;
@@ -234,50 +224,4 @@
         connection.close();
     }
 
-    
-    public void testRedeliveryOnListenerException() throws Exception {
-        Destination destination = createDestination(getClass().getName());
-        Connection connection = createConnection();
-        connection.setClientID(idGen.generateId());
-        connection.start();
-        Session consumerSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-        MessageConsumer consumer = consumerSession.createConsumer(destination);
-        
-        final ArrayList<Message> receivedMessages = new ArrayList<Message>();
-        final CountDownLatch received = new CountDownLatch(6);
-        consumer.setMessageListener(new MessageListener() {
-            public void onMessage(Message message) {
-                LOG.info("got: " + message);
-                receivedMessages.add(message);
-                received.countDown();
-                if (received.getCount() == 5) {
-                    throw new RuntimeException("force redelivery on first message");
-                }
-            }
-        });
-        Session producerSession = connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
-        MessageProducer producer = producerSession.createProducer(destination);
-        producer.setDeliveryMode(deliveryMode);
-
-        TextMessage sentMsg = producerSession.createTextMessage();
-        sentMsg.setText("msg1");
-        producer.send(sentMsg);
-        producerSession.commit();
-
-        sentMsg = producerSession.createTextMessage();
-        sentMsg.setText("msg2");
-        producer.send(sentMsg);
-        producerSession.commit();
-
-        TimeUnit.SECONDS.sleep(2);
-        //assertTrue("got our redeliveries", received.await(20, TimeUnit.SECONDS));
-        assertEquals("got message one", "msg1", ((TextMessage)receivedMessages.get(0)).getText());
-        // retries
-        for (int i=1; i< 6; i++) {
-            assertEquals("got message one", "msg2", ((TextMessage)receivedMessages.get(i)).getText());
-        }
-        
-        connection.close();
-    }
-
 }



Mime
View raw message