Amqpx.Confirm (amqpx v6.0.2)
Functions that work with publisher confirms (RabbitMQ extension to Amqpx 0.9.1).
Link to this section Summary
Functions
On channel with confirm activated, return the next message sequence number.
To use in combination with register_confirm_handler/2
This registers a handler for confirms on channel. The handler will receive either
This registers a handler to deal with channel flow notifications.
This registers a handler to deal with returned messages.
Activates publishing confirmations on the channel.
This removes the confirm handler, if it exists. Does nothing if there is no such handler.
This removes the flow handler, if it exists. Does nothing if there is no such handler.
This removes the return handler, if it exists. Does nothing if there is no such handler.
Wait until all messages published since the last call have been either ack'd or nack'd by the broker.
Wait until all messages published since the last call have been either ack'd or nack'd by the broker, or until timeout elapses.
Wait until all messages published since the last call have been either ack'd or nack'd by the broker, or until timeout elapses. If any of the messages were nack'd, the calling process dies.
Link to this section Functions
next_publish_seqno(channel)
@spec next_publish_seqno(Amqpx.Channel.t()) :: non_neg_integer()
On channel with confirm activated, return the next message sequence number.
To use in combination with register_confirm_handler/2
register_confirm_handler(channel, handler_pid)
@spec register_confirm_handler(Amqpx.Channel.t(), pid()) :: :ok
This registers a handler for confirms on channel. The handler will receive either:
{:basic_ack, seqno, multiple}
{:basic_nack, seqno, multiple}
The seqno
(delivery_tag) is an integer, the sequence number of the message.
multiple
is a boolean, when true
means multiple messages confirm, upto seqno
.
see https://www.rabbitmq.com/confirms.html
register_flow_handler(channel, handler_pid)
@spec register_flow_handler(Amqpx.Channel.t(), pid()) :: :ok
This registers a handler to deal with channel flow notifications.
register_return_handler(channel, handler_pid)
@spec register_return_handler(Amqpx.Channel.t(), pid()) :: :ok
This registers a handler to deal with returned messages.
select(channel)
@spec select(Amqpx.Channel.t()) :: :ok | Amqpx.Basic.error()
Activates publishing confirmations on the channel.
unregister_confirm_handler(channel)
@spec unregister_confirm_handler(Amqpx.Channel.t()) :: :ok
This removes the confirm handler, if it exists. Does nothing if there is no such handler.
unregister_flow_handler(channel)
@spec unregister_flow_handler(Amqpx.Channel.t()) :: :ok
This removes the flow handler, if it exists. Does nothing if there is no such handler.
unregister_return_handler(channel)
@spec unregister_return_handler(Amqpx.Channel.t()) :: :ok
This removes the return handler, if it exists. Does nothing if there is no such handler.
wait_for_confirms(channel)
@spec wait_for_confirms(Amqpx.Channel.t()) :: boolean() | :timeout
Wait until all messages published since the last call have been either ack'd or nack'd by the broker.
wait_for_confirms(channel, timeout)
@spec wait_for_confirms(Amqpx.Channel.t(), non_neg_integer()) :: boolean() | :timeout
Wait until all messages published since the last call have been either ack'd or nack'd by the broker, or until timeout elapses.
wait_for_confirms_or_die(channel)
@spec wait_for_confirms_or_die(Amqpx.Channel.t()) :: true
Wait until all messages published since the last call have been either ack'd or nack'd by the broker, or until timeout elapses. If any of the messages were nack'd, the calling process dies.
wait_for_confirms_or_die(channel, timeout)
@spec wait_for_confirms_or_die(Amqpx.Channel.t(), non_neg_integer()) :: true