Skip to content

Commit

Permalink
[fix][broker] Do not use IO thread for consumerFlow in Shared subscri…
Browse files Browse the repository at this point in the history
…ption (apache#16304)
  • Loading branch information
eolivelli authored and gavingaozhangmin committed Jul 14, 2022
1 parent 52b2208 commit 163c360
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,13 @@ public synchronized void removeConsumer(Consumer consumer) throws BrokerServiceE
}

@Override
public synchronized void consumerFlow(Consumer consumer, int additionalNumberOfMessages) {
public void consumerFlow(Consumer consumer, int additionalNumberOfMessages) {
topic.getBrokerService().executor().execute(() -> {
internalConsumerFlow(consumer, additionalNumberOfMessages);
});
}

private synchronized void internalConsumerFlow(Consumer consumer, int additionalNumberOfMessages) {
if (!consumerSet.contains(consumer)) {
if (log.isDebugEnabled()) {
log.debug("[{}] Ignoring flow control from disconnected consumer {}", name, consumer);
Expand Down

0 comments on commit 163c360

Please sign in to comment.