Amqpx.Gen.Consumer behaviour (amqpx v6.1.2)

Generic implementation of amqp consumer

Summary

Functions

Returns a specification to start this module under a supervisor.

Callback implementation for GenServer.init/1.

Types

signal_status()

@type signal_status() :: :running | :draining | :stopping

state()

@type state() :: %Amqpx.Gen.Consumer{
  backoff: term(),
  cancelled?: term(),
  channel: term(),
  connection_name: term(),
  handler_module: term(),
  handler_state: term(),
  prefetch_count: term(),
  requeue_on_reject: term()
}

Callbacks

handle_message(any, map, map)

@callback handle_message(any(), map(), map()) :: {:ok, map()} | {:error, any()}

handle_message_rejection(message, error)

(optional)
@callback handle_message_rejection(message :: any(), error :: any()) ::
  :ok | {:error, any()}

setup t

@callback setup(Amqpx.Channel.t()) :: {:ok, map()} | {:error, any()}

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

init(opts)

Callback implementation for GenServer.init/1.

start_link(opts)

@spec start_link(opts :: map()) :: GenServer.server()