diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java index 6bba4e13bc..61d29333bc 100644 --- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java +++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java @@ -298,8 +298,9 @@ public class AMQConsumer { } } if (ack.isExpiredAck()) { - //adjust delivering count for expired messages - this.serverConsumer.getQueue().decDelivering(ackList.size()); + for (MessageReference ref : ackList) { + ref.getQueue().expire(ref); + } } }