Amqpx.Helper (amqpx v7.0.0)

Helper functions

Summary

Types

dead_letter_queue_spec()

@type dead_letter_queue_spec() :: %{
  :queue => Amqpx.Basic.queue(),
  :exchange => Amqpx.Basic.exchange(),
  :routing_key => String.t(),
  optional(:original_routing_keys) => [String.t()],
  optional(:queue_opts) => Keyword.t()
}

exchange_spec()

@type exchange_spec() :: %{
  name: Amqpx.Basic.exchange(),
  type: atom(),
  routing_keys: [String.t()],
  opts: Keyword.t()
}

module_spec()

@type module_spec() :: {module(), arg :: any()}

queue_spec()

@type queue_spec() :: %{
  :queue => Amqpx.Basic.queue(),
  :exchanges => [exchange_spec()],
  optional(:opts) => Keyword.t()
}

Functions

consumers_supervisor_configuration(handlers_conf)

@spec consumers_supervisor_configuration([handler_conf :: map()]) :: [
  Supervisor.child_spec()
]

declare(channel, queue)

@spec declare(Amqpx.Channel.t(), queue_spec()) :: :ok | no_return()

encrypt_password(config)

@spec encrypt_password(Keyword.t()) :: Keyword.t()

get_password(config, params)

@spec get_password(Keyword.t(), Keyword.t() | nil) :: Keyword.value()

manager_supervisor_configuration(config)

@spec manager_supervisor_configuration(Keyword.t()) :: module_spec()

producer_supervisor_configuration(producer_conf)

@spec producer_supervisor_configuration(producer_conf :: map()) :: module_spec()

setup_dead_lettering(channel, spec)

@spec setup_dead_lettering(Amqpx.Channel.t(), dead_letter_queue_spec()) ::
  :ok | {:ok, map()} | Amqpx.Basic.error()

setup_exchange(channel, map)

setup_exchange(channel, queue, conf)

@spec setup_exchange(Amqpx.Channel.t(), Amqpx.Basic.queue(), exchange_spec()) ::
  :ok | Amqpx.Basic.error() | no_return()

setup_queue(channel, map)

@spec setup_queue(Amqpx.Channel.t(), queue_spec()) :: :ok | no_return()