DefaultAMQPChannel

open class DefaultAMQPChannel(val connection: DefaultAMQPConnection, val id: ChannelId, val frameMax: UInt) : AMQPChannel

Constructors

Link copied to clipboard
constructor(connection: DefaultAMQPConnection, id: ChannelId, frameMax: UInt)

Properties

Link copied to clipboard
open override val channelClosed: CompletableDeferred<AMQPException.ChannelClosed>

A deferred that completes when the channek is closed.

Link copied to clipboard
val channelResponses: MutableSharedFlow<AMQPResponse>
Link copied to clipboard

A flow of closed responses from the channel.

Link copied to clipboard
Link copied to clipboard

A flow of basic delivery messages.

Link copied to clipboard
Link copied to clipboard
open override val id: ChannelId

Unique identifier of the channel.

Link copied to clipboard
open override var isConfirmMode: Boolean

True when the channel is in confirm mode.

Link copied to clipboard
open override var isTxMode: Boolean

True when the channel is in transaction mode.

Link copied to clipboard
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
open override var state: ConnectionState

The channel connection state.

Link copied to clipboard
val writeMutex: Mutex

Functions

Link copied to clipboard
open suspend override fun basicAck(message: AMQPMessage, multiple: Boolean)
open suspend override fun basicAck(deliveryTag: ULong, multiple: Boolean)

Acknowledge a message.

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

Cancel sending messages from server to consumer.

Link copied to clipboard
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.

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.

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

Get a single message from a queue.

Link copied to clipboard
open suspend override fun basicNack(message: AMQPMessage, multiple: Boolean, requeue: Boolean)
open suspend override fun basicNack(deliveryTag: ULong, multiple: Boolean, requeue: Boolean)

Reject a message.

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

Publish a ByteArray message to exchange or queue.

Link copied to clipboard
open suspend override fun basicQos(count: UShort, global: Boolean): 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
open suspend override fun basicRecover(requeue: Boolean): 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
open suspend override fun basicReject(message: AMQPMessage, requeue: Boolean)
open suspend override fun basicReject(deliveryTag: ULong, requeue: Boolean)

Reject a message.

Link copied to clipboard
open suspend fun cancelAll(channelClosed: AMQPException.ChannelClosed)
Link copied to clipboard
open suspend override 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
open suspend override fun consumerCount(name: String): UInt

Returns the number of consumers subscribed to a queue.

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

Bind an exchange to another exchange.

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

Declare an exchange.

Link copied to clipboard

Passively declare an exchange.

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

Delete an exchange.

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

Unbind an exchange from another exchange.

Link copied to clipboard
open suspend override 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
open suspend override fun messageCount(name: String): UInt

Returns the number of messages in a queue.

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

Opens the channel.

Link copied to clipboard
open suspend override fun queueBind(queue: String, exchange: String, routingKey: String, arguments: Table): AMQPResponse.Channel.Queue.Bound

Binds a queue to an exchange.

Link copied to clipboard

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

open suspend override fun queueDeclare(name: String, durable: Boolean, exclusive: Boolean, autoDelete: Boolean, arguments: Table): AMQPResponse.Channel.Queue.Declared

Declares a queue.

Link copied to clipboard

Passively declares a queue.

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

Deletes a queue.

Link copied to clipboard
open suspend override fun queuePurge(name: String): AMQPResponse.Channel.Queue.Purged

Deletes all messages from a queue.

Link copied to clipboard
open suspend override fun queueUnbind(queue: String, exchange: String, routingKey: String, arguments: Table): AMQPResponse.Channel.Queue.Unbound

Unbinds a queue from an exchange.

Link copied to clipboard
open suspend override fun txCommit(): AMQPResponse.Channel.Tx.Committed

Commit a transaction.

Link copied to clipboard
open suspend override fun txRollback(): AMQPResponse.Channel.Tx.Rollbacked

Rollback a transaction.

Link copied to clipboard
open suspend override fun txSelect(): AMQPResponse.Channel.Tx.Selected

Set channel in transaction mode.

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

Internal API to write raw frames to the channel.

Link copied to clipboard
inline suspend fun <T : AMQPResponse> writeAndWaitForResponse(vararg frames: Frame): T