Amqpx.DirectConsumer (amqpx v7.2.0)
This module "wraps" the amqp_direct_consumer module to manage the race condition that occurs at supervisor shutdown, leading to error logs such as:
[error] GenServer #PID<0.846.0> terminating
** (stop) {:error, {:consumer_died, :shutdown}}
Last message: {:DOWN, #Reference<0.1010163881.3799777283.106124>, :process, #PID<0.798.0>, :shutdown}.The reason for this behavior is that the amqp_direct_consumer module considers any exit reason other than :normal as an error, prompting it to exit.
In our implementation, we have introduced two pattern matches to treat the exit reasons :shutdown and {:shutdown, reason} as normal occurrences; these conditions typically arise when the supervisor terminates the consumer, such as during a standard shutdown of the application."
Summary
Functions
Callback implementation for :amqp_gen_consumer.handle_call/3.
Callback implementation for :amqp_gen_consumer.handle_cancel/2.
Callback implementation for :amqp_gen_consumer.handle_cancel_ok/3.
Callback implementation for :amqp_gen_consumer.handle_consume/3.
Callback implementation for :amqp_gen_consumer.handle_consume_ok/3.
Callback implementation for :amqp_gen_consumer.handle_deliver/3.
Callback implementation for :amqp_gen_consumer.handle_deliver/4.
Callback implementation for :amqp_gen_consumer.handle_info/2.
Callback implementation for :amqp_gen_consumer.handle_server_cancel/2.
Callback implementation for :amqp_gen_consumer.init/1.
Callback implementation for :amqp_gen_consumer.terminate/2.
Functions
Callback implementation for :amqp_gen_consumer.handle_call/3.
Callback implementation for :amqp_gen_consumer.handle_cancel/2.
Callback implementation for :amqp_gen_consumer.handle_cancel_ok/3.
Callback implementation for :amqp_gen_consumer.handle_consume/3.
Callback implementation for :amqp_gen_consumer.handle_consume_ok/3.
Callback implementation for :amqp_gen_consumer.handle_deliver/3.
Callback implementation for :amqp_gen_consumer.handle_deliver/4.
Callback implementation for :amqp_gen_consumer.handle_info/2.
Callback implementation for :amqp_gen_consumer.handle_server_cancel/2.
Callback implementation for :amqp_gen_consumer.init/1.
Callback implementation for :amqp_gen_consumer.terminate/2.