MessagingService
open class MessagingService(val host: String, val user: String, val password: String, val exchange: IMessagingExchange, val queue: IMessagingQueue, val keys: List<IMessagingKey>, val handleMessagingUseCaseFactory: () -> IHandleMessagingUseCase, val coroutineScope: CoroutineScope, val json: Json? = null, val autoConnect: Boolean = true, val autoListen: Boolean = true, val persistent: Boolean = false, val quorum: Boolean = false, val dead: Boolean = false, val prefetchCount: UShort, val maxXDeathCount: Int = 1, val connectionName: String = queue.queue) : IMessagingService
A robust messaging service that handles connection, setup, publishing, and listening for messages.
Inheritors
Constructors
Link copied to clipboard
constructor(host: String, user: String, password: String, exchange: IMessagingExchange, queue: IMessagingQueue, keys: List<IMessagingKey>, handleMessagingUseCaseFactory: () -> IHandleMessagingUseCase, coroutineScope: CoroutineScope, json: Json? = null, autoConnect: Boolean = true, autoListen: Boolean = true, persistent: Boolean = false, quorum: Boolean = false, dead: Boolean = false, prefetchCount: UShort, maxXDeathCount: Int = 1, connectionName: String = queue.queue)
Properties
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
A Deferred that completes when the connection and channels are ready.
Link copied to clipboard
The raw AMQP connection instance.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
A Deferred that completes when the setup process is finished.
Functions
Link copied to clipboard
open suspend override fun exchangeDeclare(exchange: IMessagingExchange, type: String, arguments: Map<String, Field>)
Declares an exchange with the specified parameters.
Link copied to clipboard
open suspend fun handleException(delivery: AMQPResponse.Channel.Message.Delivery, exception: Exception)
Link copied to clipboard
open suspend fun handleFailedMessage(delivery: AMQPResponse.Channel.Message.Delivery, exception: Exception)
Link copied to clipboard
inline suspend fun <T> publish(routingKey: IMessagingKey, value: T, exchange: IMessagingExchange? = null, persistent: Boolean = false, attempts: Int = 3, delay: Long = 5000, crossinline configureProperties: PropertiesBuilder.() -> Unit = {})
Link copied to clipboard
open suspend override fun queueBind(queue: IMessagingQueue, exchange: IMessagingExchange, routingKey: IMessagingKey, arguments: Map<String, Field>)
Binds a queue to an exchange with the specified routing key and arguments.
Link copied to clipboard
open suspend override fun queueDeclare(queue: IMessagingQueue, exchange: IMessagingExchange?, durable: Boolean, exclusive: Boolean, autoDelete: Boolean, arguments: Map<String, Field>)
Declares a queue with the specified parameters.
Link copied to clipboard