Freddy.Core.Exchange (freddy v0.17.1)

Exchange configuration.

Fields

  • :name - Exchange name. If left empty, default exchange will be used.
  • :type - Exchange type. Can be :direct, :topic, :fanout or an arbitrary string, such as "x-delayed-message". Default is :direct.
  • :opts - Exchange options. See below.

Exchange options

  • :durable - If set, keeps the Exchange between restarts of the broker.
  • :auto_delete - If set, deletes the Exchange once all queues unbind from it.
  • :passive - If set, returns an error if the Exchange does not already exist.
  • :internal - If set, the exchange may not be used directly by publishers, but only when bound to other exchanges. Internal exchanges are used to construct wiring that is not visible to applications.
  • :nowait - If set, the server will not respond to the method and client will not wait for a reply. Default is false.
  • :arguments - A set of arguments for the declaration. The syntax and semantics of these arguments depends on the server implementation.

Example

iex> %Freddy.Core.Exchange{name: "freddy-topic", type: :topic, durable: true}

Link to this section Summary

Functions

Returns default exchange configuration. Such exchange implicitly exists in RabbitMQ and can't be declared by the clients.

Create exchange configuration from keyword list or Freddy.Core.Exchange structure.

Link to this section Types

Specs

options() :: [
  durable: boolean(),
  auto_delete: boolean(),
  passive: boolean(),
  internal: boolean(),
  nowait: boolean(),
  arguments: Keyword.t()
]

Specs

t() :: %Freddy.Core.Exchange{
  name: String.t(),
  opts: options(),
  type: atom() | String.t()
}

Link to this section Functions

Specs

default() :: t()

Returns default exchange configuration. Such exchange implicitly exists in RabbitMQ and can't be declared by the clients.

Specs

new(t() | Keyword.t()) :: t()

Create exchange configuration from keyword list or Freddy.Core.Exchange structure.