AMQPChannel

interface AMQPChannel

Inheritors

Properties

Link copied to clipboard

A deferred that completes when the channek is closed.

Link copied to clipboard

A flow of closed responses from the channel.

Link copied to clipboard

A flow of basic delivery messages.

Link copied to clipboard
abstract val id: ChannelId

Unique identifier of the channel.

Link copied to clipboard
abstract val isConfirmMode: Boolean

True when the channel is in confirm mode.

Link copied to clipboard
abstract val isTxMode: Boolean

True when the channel is in transaction mode.

Link copied to clipboard

A flow of opened responses from the channel.

Link copied to clipboard

A flow of basic publish confirm responses.

Link copied to clipboard

A flow of basic return responses.

Link copied to clipboard
abstract val state: ConnectionState

The channel connection state.

Functions

Link copied to clipboard
abstract suspend fun basicAck(message: AMQPMessage, multiple: Boolean = false)
abstract suspend fun basicAck(deliveryTag: ULong, multiple: Boolean = false)

Acknowledge a message.

Link copied to clipboard
abstract suspend fun basicCancel(consumerTag: String): AMQPResponse.Channel.Basic.Canceled

Cancel sending messages from server to consumer.

Link copied to clipboard
abstract suspend fun basicConsume(queue: String, consumerTag: String = "", noAck: Boolean = false, exclusive: Boolean = false, arguments: Table = emptyMap()): AMQPReceiveChannel

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

abstract suspend fun basicConsume(queue: String, consumerTag: String = "", noAck: Boolean = false, exclusive: Boolean = false, arguments: Table = emptyMap(), 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.

Link copied to clipboard
abstract suspend fun basicGet(queue: String, noAck: Boolean = false): AMQPResponse.Channel.Message.Get

Get a single message from a queue.

Link copied to clipboard

Get a single message using a FetchedMessage instance.

Get a single message using a FetchedMessageBuilder block.

Link copied to clipboard
abstract suspend fun basicNack(message: AMQPMessage, multiple: Boolean = false, requeue: Boolean = false)
abstract suspend fun basicNack(deliveryTag: ULong, multiple: Boolean = false, requeue: Boolean = false)

Reject a message.

Link copied to clipboard
abstract suspend fun basicPublish(body: ByteArray, exchange: String, routingKey: String, mandatory: Boolean = false, immediate: Boolean = false, properties: Properties = Properties()): AMQPResponse.Channel.Basic.Published

Publish a ByteArray message to exchange or queue.

Link copied to clipboard

Publish a ByteArray message using a PublishedMessage instance.

Publish a ByteArray message using a PublishedMessageBuilder block.

Link copied to clipboard
abstract suspend fun basicQos(count: UShort, global: Boolean = false): AMQPResponse.Channel.Basic.QosOk

Sets a prefetch limit when consuming messages. No more messages will be delivered to the consumer until one or more messages have been acknowledged or rejected.

Link copied to clipboard

Declares QoS settings using a DeclaredQos instance.

Declares QoS settings using a DeclaredQosBuilder block.

Link copied to clipboard
abstract suspend fun basicRecover(requeue: Boolean = false): AMQPResponse.Channel.Basic.Recovered

Tell the broker what to do with all unacknowledged messages. Unacknowledged messages retrieved by basicGet are requeued regardless.

Link copied to clipboard

Recover unacknowledged messages using a RecoveredMessages instance.

Recover unacknowledged messages using a RecoveredMessagesBuilder block.

Link copied to clipboard
abstract suspend fun basicReject(message: AMQPMessage, requeue: Boolean = false)
abstract suspend fun basicReject(deliveryTag: ULong, requeue: Boolean = false)

Reject a message.

Link copied to clipboard
abstract suspend fun close(reason: String = "", code: UShort): AMQPResponse.Channel.Closed

Closes the channel.

Link copied to clipboard

Set channel in publish confirm mode, each published message will be acked or nacked.

Link copied to clipboard

Set channel in publish confirm mode using a SelectedConfirmMode instance.

Set channel in publish confirm mode using a SelectedConfirmModeBuilder block.

Link copied to clipboard
abstract suspend fun consumerCount(name: String): UInt

Returns the number of consumers subscribed to a queue.

Link copied to clipboard
abstract suspend fun exchangeBind(destination: String, source: String, routingKey: String, arguments: Table = emptyMap()): AMQPResponse.Channel.Exchange.Bound

Bind an exchange to another exchange.

Link copied to clipboard

Binds an exchange using a BoundExchange instance.

Binds an exchange using a BoundExchangeBuilder block.

Link copied to clipboard
abstract suspend fun exchangeDeclare(name: String, type: String, durable: Boolean = false, autoDelete: Boolean = false, internal: Boolean = false, arguments: Table = emptyMap()): AMQPResponse.Channel.Exchange.Declared

Declare an exchange.

Link copied to clipboard

Declares an exchange using a DeclaredExchange instance.

Declares an exchange using a DeclaredExchangeBuilder block.

Link copied to clipboard

Passively declare an exchange.

Link copied to clipboard

Passively declares an exchange using a DeclaredPassiveExchange instance.

Passively declares an exchange using a DeclaredPassiveExchangeBuilder block.

Link copied to clipboard
abstract suspend fun exchangeDelete(name: String, ifUnused: Boolean = false): AMQPResponse.Channel.Exchange.Deleted

Delete an exchange.

Link copied to clipboard

Deletes an exchange using a DeletedExchange instance.

Deletes an exchange using a DeletedExchangeBuilder block.

Link copied to clipboard
abstract suspend fun exchangeUnbind(destination: String, source: String, routingKey: String, arguments: Table = emptyMap()): AMQPResponse.Channel.Exchange.Unbound

Unbind an exchange from another exchange.

Link copied to clipboard

Unbinds an exchange using a UnboundExchange instance.

Unbinds an exchange using a UnboundExchangeBuilder block.

Link copied to clipboard
abstract suspend fun flow(active: Boolean): AMQPResponse.Channel.Flowed

Send a flow message to broker to start or stop sending messages to consumers. Warning: Not supported by all brokers.

Link copied to clipboard

Send a flow message to broker using a ControlledFlow instance.

Send a flow message to broker using a ControlledFlowBuilder block.

Link copied to clipboard
abstract suspend fun messageCount(name: String): UInt

Returns the number of messages in a queue.

Link copied to clipboard
abstract suspend fun open(): AMQPResponse.Channel.Opened

Opens the channel.

Link copied to clipboard
abstract suspend fun queueBind(queue: String, exchange: String, routingKey: String = "", arguments: Table = emptyMap()): AMQPResponse.Channel.Queue.Bound

Binds a queue to an exchange.

Link copied to clipboard

Binds a queue using a BoundQueue instance.

Binds a queue using a BoundQueueBuilder block.

Link copied to clipboard

Declare a server-named exclusive, autodelete, non-durable queue.

abstract suspend fun queueDeclare(name: String, durable: Boolean = false, exclusive: Boolean = false, autoDelete: Boolean = false, arguments: Table = emptyMap()): AMQPResponse.Channel.Queue.Declared

Declares a queue.

Link copied to clipboard

Declares a queue using a DeclaredQueue instance.

Declares a queue using a DeclaredQueueBuilder block.

Link copied to clipboard

Passively declares a queue.

Link copied to clipboard

Passively declares a queue using a DeclaredPassiveQueue instance.

Passively declares a queue using a DeclaredPassiveQueueBuilder block.

Link copied to clipboard
abstract suspend fun queueDelete(name: String, ifUnused: Boolean = false, ifEmpty: Boolean = false): AMQPResponse.Channel.Queue.Deleted

Deletes a queue.

Link copied to clipboard

Deletes a queue using a DeletedQueue instance.

Deletes a queue using a DeletedQueueBuilder block.

Link copied to clipboard

Deletes all messages from a queue.

Link copied to clipboard

Purges a queue using a PurgedQueue instance.

Purges a queue using a PurgedQueueBuilder block.

Link copied to clipboard
abstract suspend fun queueUnbind(queue: String, exchange: String, routingKey: String = "", arguments: Table = emptyMap()): AMQPResponse.Channel.Queue.Unbound

Unbinds a queue from an exchange.

Link copied to clipboard

Unbinds a queue using a UnboundQueue instance.

Unbinds a queue using a UnboundQueueBuilder block.

Link copied to clipboard

Commit a transaction.

Link copied to clipboard

Commit a transaction using a CommittedTransaction instance.

Commit a transaction using a CommittedTransactionBuilder block.

Link copied to clipboard

Rollback a transaction.

Link copied to clipboard

Rollback a transaction using a RolledbackTransaction instance.

Rollback a transaction using a RolledbackTransactionBuilder block.

Link copied to clipboard

Set channel in transaction mode.

Link copied to clipboard

Set channel in transaction mode using a SelectedTransactionMode instance.

Set channel in transaction mode using a SelectedTransactionModeBuilder block.

Link copied to clipboard
abstract suspend fun write(vararg frames: Frame)

Internal API to write raw frames to the channel.