basicConsume

open suspend override fun basicConsume(queue: String, consumerTag: String, noAck: Boolean, exclusive: Boolean, arguments: Table): AMQPReceiveChannel

Consume messages from a queue by sending them to the channel. The consumer is automatically canceled when the channel is closed.

Return

AMQPResponse.Channel.Basic.ConsumeOk confirming that broker has accepted the consume request.

Parameters

queue

Name of the queue.

consumerTag

Name of the consumer; if empty, will be generated by the broker.

noAck

Controls whether message will be acked or nacked automatically (true) or manually (false).

exclusive

Ensures that queue can only be consumed by a single consumer.

arguments

Additional arguments (check RabbitMQ documentation).


open suspend override fun basicConsume(queue: String, consumerTag: String, noAck: Boolean, exclusive: Boolean, arguments: Table, onDelivery: suspend (AMQPResponse.Channel.Message.Delivery) -> Unit, onCanceled: suspend (AMQPResponse.Channel) -> Unit): AMQPResponse.Channel.Basic.ConsumeOk

Consume messages from a queue by sending them to registered consume listeners. The caller is responsible for cancelling the consumer when done.

Return

AMQPResponse.Channel.Basic.ConsumeOk confirming that broker has accepted the consume request.

Parameters

queue

Name of the queue.

consumerTag

Name of the consumer; if empty, will be generated by the broker.

noAck

Controls whether message will be acked or nacked automatically (true) or manually (false).

exclusive

Ensures that queue can only be consumed by a single consumer.

arguments

Additional arguments (check RabbitMQ documentation).

onDelivery

: Callback when Delivery arrives - automatically registered.

onCanceled

: Callback when consumer is canceled - automatically registered.