Amqpx.Basic.get

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

get(channel, queue, options \\ [])

Specs

get(Amqpx.Channel.t(), queue(), keyword()) ::
  {:ok, String.t(), map()} | {:empty, map()} | error()

Polls a queue for an existing message.

Returns the tuple {:empty, meta} if the queue is empty or the tuple {:ok, payload, meta} if at least one message exists in the queue. The returned meta map includes the entry :message_count with the current number of messages in the queue.

Receiving messages by polling a queue is not as as efficient as subscribing a consumer to a queue, so consideration should be taken when receiving large volumes of messages.

Options

  • :no_ack - If set, the broker is told that the received will not send an acknoledgement of the message. Once the broker believes it has delivered the message, then it's free to assume that the consuming application has taken responsibility for it. In general, a lot of applications will not want these semantics, rather, they will want to explicitly acknowledge the receipt of a message (through ack/3). Defaults to false (meaning explicit acks).