Don't set the first message id if it's not known. It gets calcuated on the server side.

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@697850 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2008-09-22 14:32:03 +00:00
parent 553deac60a
commit 93439b2853
1 changed files with 1 additions and 3 deletions

View File

@ -837,9 +837,7 @@ public class ActiveMQMessageConsumer implements MessageAvailableConsumer, StatsC
deliveredCounter++; deliveredCounter++;
if ((0.5 * info.getPrefetchSize()) <= (deliveredCounter - additionalWindowSize)) { if ((0.5 * info.getPrefetchSize()) <= (deliveredCounter - additionalWindowSize)) {
MessageAck ack = new MessageAck(md, ackType, deliveredCounter); MessageAck ack = new MessageAck(md, ackType, deliveredCounter);
if( deliveredMessages.isEmpty() ) { if( !deliveredMessages.isEmpty() ) {
ack.setFirstMessageId(ack.getLastMessageId());
} else {
ack.setFirstMessageId(deliveredMessages.getLast().getMessage().getMessageId()); ack.setFirstMessageId(deliveredMessages.getLast().getMessage().getMessageId());
} }
ack.setTransactionId(session.getTransactionContext().getTransactionId()); ack.setTransactionId(session.getTransactionContext().getTransactionId());