gamqp/amqp091/exchange

Exchanges route published messages to queues and other exchanges.

Types

pub type DeclareOptions {
  DeclareOptions(
    durable: Bool,
    auto_delete: Bool,
    internal: Bool,
    passive: Bool,
    nowait: Bool,
    arguments: List(#(String, table.FieldValue)),
  )
}

Constructors

  • DeclareOptions(
      durable: Bool,
      auto_delete: Bool,
      internal: Bool,
      passive: Bool,
      nowait: Bool,
      arguments: List(#(String, table.FieldValue)),
    )

    Arguments

    internal

    Only reachable through exchange-to-exchange bindings.

    passive

    Only check that the exchange exists (404 otherwise).

pub type Kind {
  Direct
  Fanout
  Topic
  Headers
  Custom(String)
}

Constructors

  • Direct
  • Fanout
  • Topic
  • Headers
  • Custom(String)

    A plugin exchange type such as x-delayed-message.

Values

pub fn bind(
  channel: client.Channel,
  destination destination: String,
  source source: String,
  routing_key routing_key: String,
  arguments arguments: List(#(String, table.FieldValue)),
) -> Result(Nil, core.AmqpError)

Routes messages from source to destination, a RabbitMQ extension.

pub fn check(
  channel: client.Channel,
  name: String,
) -> Result(Nil, core.AmqpError)

Fails with ChannelClosed(404, _) when the exchange does not exist.

pub fn declare(
  channel: client.Channel,
  name: String,
  kind: Kind,
  options: DeclareOptions,
) -> Result(Nil, core.AmqpError)
pub fn declare_options() -> DeclareOptions

A durable exchange that stays when unused.

pub fn delete(
  channel: client.Channel,
  name: String,
  if_unused if_unused: Bool,
) -> Result(Nil, core.AmqpError)
pub fn unbind(
  channel: client.Channel,
  destination destination: String,
  source source: String,
  routing_key routing_key: String,
  arguments arguments: List(#(String, table.FieldValue)),
) -> Result(Nil, core.AmqpError)
✨ Search Document