RMQ v0.4.0 RMQ.Utils View Source

Utility functions.

Link to this section Summary

Functions

Acknowledges one or more messages.

Produces a reply to the message.

Link to this section Functions

Link to this function

ack(chan, delivery_tag_or_meta, options \\ [])

View Source

Specs

ack(
  chan :: AMQP.Channel.t(),
  delivery_tag_or_meta :: binary() | map(),
  options :: keyword()
) :: :ok | (error :: any())

Acknowledges one or more messages.

It's the same as AMQP.Basic.ack/3 but with the ability to extract delivery_tag from the provided message meta.

Link to this function

reply(chan, meta, payload, options \\ [])

View Source

Specs

reply(
  chan :: AMQP.Channel.t(),
  meta :: map(),
  payload :: any(),
  options :: keyword()
) :: :ok | (error :: any())

Produces a reply to the message.

It's basically just a wrapper around AMQP.Basic.publish/5 which helps you properly publish a reply based on the message meta.

When the given payload is not a string it will be encoded by using Jason.encode/2.