added support for clearing messages in-flight

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@393495 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2006-04-12 16:18:36 +00:00
parent 00d054a6c2
commit 52ee976ec8
1 changed files with 7 additions and 2 deletions

View File

@ -189,8 +189,9 @@ public class ActiveMQMessageConsumer implements MessageAvailableConsumer, StatsC
this.session.removeConsumer(this);
throw e;
}
this.optimizeAcknowledge=session.connection.isOptimizeAcknowledge()&&session.isAutoAcknowledge();
if (session.connection.isStarted())
this.optimizeAcknowledge=session.connection.isOptimizeAcknowledge()&&session.isAutoAcknowledge()
&&!info.isDurable()&&!info.getDestination().isQueue();
if(session.connection.isStarted())
start();
}
@ -507,6 +508,10 @@ public class ActiveMQMessageConsumer implements MessageAvailableConsumer, StatsC
this.session.syncSendPacket(info.createRemoveCommand());
}
}
public void clearMessagesInProgress(){
unconsumedMessages.clear();
}
public void dispose() throws JMSException {
if (!unconsumedMessages.isClosed()) {