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) oramq.direct
-
:fanout
exchange:amq.fanout
-
:topic
exchange:amq.topic
-
:headers
exchange:amq.match
(andamq.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 tofalse
.:arguments
- A list of arguments to pass when declaring (of typeAmqpx.arguments/0
). See the README for more information. Defaults to[]
.