Fixing the JMSConsumerTest case.

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@696372 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2008-09-17 17:15:31 +00:00
parent d453b8d390
commit a2101b7b05
1 changed files with 5 additions and 1 deletions

View File

@ -837,7 +837,11 @@ public class ActiveMQMessageConsumer implements MessageAvailableConsumer, StatsC
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;