Skip to content

Commit 4081252

Browse files
committed
[#2198] Fix pendingSends count to decrement on rolled-back send
1 parent 0149683 commit 4081252

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • activemq-broker/src/main/java/org/apache/activemq/broker/region

activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public class Queue extends BaseDestination implements Task, UsageListener, Index
125125
// this is guarded by pagedInPendingDispatchLock
126126
private final Map<QueueMessageReference, ActiveMQMessageFormatException> dispatchMessageFormatErrors = new LinkedHashMap<>();
127127
protected QueueDispatchPendingList dispatchPendingList = new QueueDispatchPendingList();
128-
private AtomicInteger pendingSends = new AtomicInteger(0);
128+
private final AtomicInteger pendingSends = new AtomicInteger(0);
129129
private MessageGroupMap messageGroupOwners;
130130
private DispatchPolicy dispatchPolicy = new RoundRobinDispatchPolicy();
131131
private MessageGroupMapFactory messageGroupMapFactory = new CachedMessageGroupMapFactory();
@@ -888,6 +888,7 @@ public void afterRollback() throws Exception {
888888
if (store != null && messageContext.message.isPersistent()) {
889889
rollbackPendingCursorAdditions(messageContext.message.getMessageId());
890890
}
891+
pendingSends.decrementAndGet();
891892
messageContext.message.decrementReferenceCount();
892893
}
893894
}

0 commit comments

Comments
 (0)