activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r696372 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
Date Wed, 17 Sep 2008 17:15:31 GMT
Author: chirino
Date: Wed Sep 17 10:15:31 2008
New Revision: 696372

URL: http://svn.apache.org/viewvc?rev=696372&view=rev
Log:
Fixing the JMSConsumerTest case. 


Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java?rev=696372&r1=696371&r2=696372&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
Wed Sep 17 10:15:31 2008
@@ -837,7 +837,11 @@
         deliveredCounter++;
         if ((0.5 * info.getPrefetchSize()) <= (deliveredCounter - additionalWindowSize))
{
             MessageAck ack = new MessageAck(md, ackType, deliveredCounter);
-            ack.setFirstMessageId(deliveredMessages.getLast().getMessage().getMessageId());
+            if( deliveredMessages.isEmpty() ) {
+            	ack.setFirstMessageId(ack.getLastMessageId());
+            } else {
+            	ack.setFirstMessageId(deliveredMessages.getLast().getMessage().getMessageId());
+            }
             ack.setTransactionId(session.getTransactionContext().getTransactionId());
             session.sendAck(ack);
             additionalWindowSize = deliveredCounter;



Mime
View raw message