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 Channelprivate final AMQConnectionprivate CountDownLatchprivate booleanprivate ShutdownSignalExceptionprivate booleanprivate final ConsumerWorkService -
Constructor Summary
ConstructorsConstructorDescriptionConsumerDispatcher(AMQConnection connection, Channel channel, ConsumerWorkService workService) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate voidprivate voidvoidhandleCancel(Consumer delegate, String consumerTag) voidhandleCancelOk(Consumer delegate, String consumerTag) voidhandleConsumeOk(Consumer delegate, String consumerTag) voidhandleDelivery(Consumer delegate, String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) voidhandleRecoverOk(Consumer delegate, String consumerTag) handleShutdownSignal(Map<String, Consumer> consumers, ShutdownSignalException signal) private voidnotifyConsumerOfShutdown(String consumerTag, Consumer consumer, ShutdownSignalException signal) private voidnotifyConsumersOfShutdown(Map<String, Consumer> consumers, ShutdownSignalException signal) voidquiesce()Prepare for shutdown of all consumers on this channelvoidsetUnlimited(boolean unlimited) private voidshutdown(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()
-