IMessagingService

Interface defining the contract for a messaging service.

Inheritors

Properties

Link copied to clipboard
abstract val channel: AMQPChannel?

The raw AMQP channel instance.

Link copied to clipboard
abstract val channelReady: Deferred<Unit>

A Deferred that completes when the connection and channels are ready.

Link copied to clipboard
abstract val connection: AMQPConnection?

The raw AMQP connection instance.

Link copied to clipboard
abstract val setupCompleted: Deferred<Unit>

A Deferred that completes when the setup process is finished.

Functions

Link copied to clipboard
abstract suspend fun connect()

Connects to the messaging server.

Link copied to clipboard
abstract suspend fun exchangeDeclare(exchange: IMessagingExchange, type: String = BuiltinExchangeType.DIRECT, arguments: Map<String, Field> = mapOf())

Declares an exchange with the specified parameters.

Link copied to clipboard
abstract suspend fun listen()

Starts listening for incoming messages in a coroutine.

Link copied to clipboard
abstract suspend fun queueBind(queue: IMessagingQueue, exchange: IMessagingExchange, routingKey: IMessagingKey, arguments: Map<String, Field> = mapOf())

Binds a queue to an exchange with the specified routing key and arguments.

Link copied to clipboard
abstract suspend fun queueDeclare(queue: IMessagingQueue, exchange: IMessagingExchange? = null, durable: Boolean = true, exclusive: Boolean = false, autoDelete: Boolean = false, arguments: Map<String, Field> = mapOf())

Declares a queue with the specified parameters.

Link copied to clipboard
abstract suspend fun setup()

Sets up the necessary exchanges, queues, and bindings.