boolean doRemove = this.acknowledgeMode != Session.CLIENT_ACKNOWLEDGE;
ActiveMQMessage message;
while ((message = messageExecutor.dequeueNoWait()) != null) {
if (!message.isExpired() && listener != null) {
try {
listener.onMessage(message);
this.messageDelivered(true, message, true, false);
}
catch (Throwable t) {
log.info("Caught :" + t, t);
this.messageDelivered(true, message, false, false);