Amqpx.Exchange.declare

You're seeing just the function declare, go back to Amqpx.Exchange module for more information.
Link to this function

declare(channel, exchange, type \\ :direct, options \\ [])

Specs

declare(Amqpx.Channel.t(), Amqpx.Basic.exchange(), type :: atom(), keyword()) ::
  :ok | Amqpx.Basic.error()

Declares an Exchange. The default Exchange type is direct.

Amqpx 0-9-1 brokers provide four pre-declared exchanges:

  • :direct exchange: (empty string) or amq.direct
  • :fanout exchange: amq.fanout
  • :topic exchange: amq.topic
  • :headers exchange: amq.match (and amq.headers in RabbitMQ)

Besides the exchange name and type, the following options can be used:

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.
  • :no_wait - If set, the declare operation is asynchronous. Defaults to false.
  • :arguments - A list of arguments to pass when declaring (of type Amqpx.arguments/0). See the README for more information. Defaults to [].