amqp v1.2.1 AMQP.Exchange View Source
Functions to operate on Exchanges.
Link to this section Summary
Functions
Binds an Exchange to another Exchange or a Queue using the exchange.bind AMQP method (a RabbitMQ-specific extension)
Declares an Exchange. The default Exchange type is direct
.
Deletes an Exchange by name. When an Exchange is deleted all bindings to it are also deleted
Convenience function to declare an Exchange of type direct
.
Convenience function to declare an Exchange of type fanout
.
Convenience function to declare an Exchange of type topic
.
Unbinds an Exchange from another Exchange or a Queue using the exchange.unbind AMQP method (a RabbitMQ-specific extension)
Link to this section Functions
bind(channel, destination, source, options \\ [])
View Source
bind(
AMQP.Channel.t(),
destination :: String.t(),
source :: String.t(),
keyword()
) :: :ok | AMQP.Basic.error()
bind( AMQP.Channel.t(), destination :: String.t(), source :: String.t(), keyword() ) :: :ok | AMQP.Basic.error()
Binds an Exchange to another Exchange or a Queue using the exchange.bind AMQP method (a RabbitMQ-specific extension)
declare(channel, exchange, type \\ :direct, options \\ [])
View Source
declare(AMQP.Channel.t(), AMQP.Basic.exchange(), type :: atom(), keyword()) ::
:ok | AMQP.Basic.error()
declare(AMQP.Channel.t(), AMQP.Basic.exchange(), type :: atom(), keyword()) :: :ok | AMQP.Basic.error()
Declares an Exchange. The default Exchange type is direct
.
AMQP 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
(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.
delete(channel, exchange, options \\ [])
View Source
delete(AMQP.Channel.t(), AMQP.Basic.exchange(), keyword()) ::
:ok | AMQP.Basic.error()
delete(AMQP.Channel.t(), AMQP.Basic.exchange(), keyword()) :: :ok | AMQP.Basic.error()
Deletes an Exchange by name. When an Exchange is deleted all bindings to it are also deleted
direct(channel, exchange, options \\ [])
View Source
direct(AMQP.Channel.t(), AMQP.Basic.exchange(), keyword()) ::
:ok | AMQP.Basic.error()
direct(AMQP.Channel.t(), AMQP.Basic.exchange(), keyword()) :: :ok | AMQP.Basic.error()
Convenience function to declare an Exchange of type direct
.
fanout(channel, exchange, options \\ [])
View Source
fanout(AMQP.Channel.t(), AMQP.Basic.exchange(), keyword()) ::
:ok | AMQP.Basic.error()
fanout(AMQP.Channel.t(), AMQP.Basic.exchange(), keyword()) :: :ok | AMQP.Basic.error()
Convenience function to declare an Exchange of type fanout
.
topic(channel, exchange, options \\ [])
View Source
topic(AMQP.Channel.t(), AMQP.Basic.exchange(), keyword()) ::
:ok | AMQP.Basic.error()
topic(AMQP.Channel.t(), AMQP.Basic.exchange(), keyword()) :: :ok | AMQP.Basic.error()
Convenience function to declare an Exchange of type topic
.
unbind(channel, destination, source, options \\ [])
View Source
unbind(
AMQP.Channel.t(),
destination :: String.t(),
source :: String.t(),
keyword()
) :: :ok | AMQP.Basic.error()
unbind( AMQP.Channel.t(), destination :: String.t(), source :: String.t(), keyword() ) :: :ok | AMQP.Basic.error()
Unbinds an Exchange from another Exchange or a Queue using the exchange.unbind AMQP method (a RabbitMQ-specific extension)