Skip to content

Commit 426ca81

Browse files
author
Steve Powell
committed
Stop channel consumer work pool after channel.close()
1 parent ec4b675 commit 426ca81

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

src/com/rabbitmq/client/impl/ChannelManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public ChannelManager(ConsumerWorkService workService, int channelMax) {
5959
}
6060
_channelMax = channelMax;
6161
channelNumberAllocator = new IntAllocator(1, channelMax);
62-
62+
6363
this.workService = workService;
6464
}
6565

src/com/rabbitmq/client/impl/ConsumerDispatcher.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,11 @@
2727
import java.util.concurrent.CountDownLatch;
2828

2929
/**
30-
* Dispatches notifications to a {@link Consumer} on an
31-
* internally-managed executor service and work pool.
30+
* Dispatches notifications to a {@link Consumer} on an internally-managed executor service and work
31+
* pool.
3232
* <p/>
33-
* Each {@link Channel} has a single {@link ConsumerDispatcher},
34-
* but the executor service and work pool may be shared with other channels, typically those on the same
35-
* {@link Connection}.
33+
* Each {@link Channel} has a single {@link ConsumerDispatcher}, but the executor service and work
34+
* pool may be shared with other channels, typically those on the same {@link AMQConnection}.
3635
*/
3736
final class ConsumerDispatcher {
3837

@@ -147,6 +146,7 @@ public CountDownLatch handleShutdownSignal(final Map<String, Consumer> consumers
147146
public void run() {
148147
notifyConsumersOfShutdown(consumers, signal);
149148
ConsumerDispatcher.this.shutdown(signal);
149+
ConsumerDispatcher.this.workService.stopWork(ConsumerDispatcher.this.channel);
150150
latch.countDown();
151151
}
152152
});

src/com/rabbitmq/client/impl/ConsumerWorkService.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public void shutdown() {
5151

5252
/**
5353
* Stop executing all consumer work for a particular channel
54+
* @param channel to stop consumer work for
5455
*/
5556
public void stopWork(Channel channel) {
5657
this.workPool.unregisterKey(channel);

0 commit comments

Comments
 (0)