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

Get a single message using a FetchedMessage instance.

Get a single message using a FetchedMessageBuilder block.

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

Publish a ByteArray message using a PublishedMessage instance.

Publish a ByteArray message using a PublishedMessageBuilder block.

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

Declares QoS settings using a DeclaredQos instance.

Declares QoS settings using a DeclaredQosBuilder block.

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

Recover unacknowledged messages using a RecoveredMessages instance.

Recover unacknowledged messages using a RecoveredMessagesBuilder block.

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

Set channel in publish confirm mode using a SelectedConfirmMode instance.

Set channel in publish confirm mode using a SelectedConfirmModeBuilder block.

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

Binds an exchange using a BoundExchange instance.

Binds an exchange using a BoundExchangeBuilder block.

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

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
open suspend override fun exchangeDelete(name: String, ifUnused: Boolean): 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
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

Unbinds an exchange using a UnboundExchange instance.

Unbinds an exchange using a UnboundExchangeBuilder block.

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

Send a flow message to broker using a ControlledFlow instance.

Send a flow message to broker using a ControlledFlowBuilder block.

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

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.

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

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
open suspend override fun queueDelete(name: String, ifUnused: Boolean, ifEmpty: Boolean): 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
open suspend override fun queuePurge(name: String): AMQPResponse.Channel.Queue.Purged

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
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

Unbinds a queue using a UnboundQueue instance.

Unbinds a queue using a UnboundQueueBuilder block.

Link copied to clipboard

Determines whether this channel should be removed from the connection's channel registry when the broker closes it. Robust channels override this to return false since they restore.

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

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
open suspend override fun txRollback(): AMQPResponse.Channel.Tx.Rollbacked

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
open suspend override fun txSelect(): AMQPResponse.Channel.Tx.Selected

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
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