Package com.rabbitmq.client.impl
Class ConsumerDispatcher
java.lang.Object
com.rabbitmq.client.impl.ConsumerDispatcher
Dispatches notifications to a
Consumer
on an internally-managed executor service and work
pool.
Each Channel
has a single ConsumerDispatcher
, but the executor service and work
pool may be shared with other channels, typically those on the same AMQConnection
.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Channel
private final AMQConnection
private CountDownLatch
private boolean
private ShutdownSignalException
private boolean
private final ConsumerWorkService
-
Constructor Summary
ConstructorsConstructorDescriptionConsumerDispatcher
(AMQConnection connection, Channel channel, ConsumerWorkService workService) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
private void
private void
void
handleCancel
(Consumer delegate, String consumerTag) void
handleCancelOk
(Consumer delegate, String consumerTag) void
handleConsumeOk
(Consumer delegate, String consumerTag) void
handleDelivery
(Consumer delegate, String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) void
handleRecoverOk
(Consumer delegate, String consumerTag) handleShutdownSignal
(Map<String, Consumer> consumers, ShutdownSignalException signal) private void
notifyConsumerOfShutdown
(String consumerTag, Consumer consumer, ShutdownSignalException signal) private void
notifyConsumersOfShutdown
(Map<String, Consumer> consumers, ShutdownSignalException signal) void
quiesce()
Prepare for shutdown of all consumers on this channelvoid
setUnlimited
(boolean unlimited) private void
shutdown
(ShutdownSignalException signal)
-
Field Details
-
workService
-
connection
-
channel
-
shuttingDown
private volatile boolean shuttingDown -
shutdownConsumersDriven
private volatile boolean shutdownConsumersDriven -
shutdownConsumersComplete
-
shutdownSignal
-
-
Constructor Details
-
ConsumerDispatcher
public ConsumerDispatcher(AMQConnection connection, Channel channel, ConsumerWorkService workService)
-
-
Method Details
-
quiesce
public void quiesce()Prepare for shutdown of all consumers on this channel -
setUnlimited
public void setUnlimited(boolean unlimited) -
handleConsumeOk
-
handleCancelOk
-
handleCancel
-
handleRecoverOk
-
handleDelivery
public void handleDelivery(Consumer delegate, String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException - Throws:
IOException
-
handleShutdownSignal
public CountDownLatch handleShutdownSignal(Map<String, Consumer> consumers, ShutdownSignalException signal) -
notifyConsumersOfShutdown
private void notifyConsumersOfShutdown(Map<String, Consumer> consumers, ShutdownSignalException signal) -
notifyConsumerOfShutdown
private void notifyConsumerOfShutdown(String consumerTag, Consumer consumer, ShutdownSignalException signal) -
executeUnlessShuttingDown
-
execute
-
shutdown
-
checkShutdown
private void checkShutdown()
-