Async Messaging With Kotlin and RabbitMQ

Let’s interact with RabbitMQ by creating a simple message producer and consumer in Kotlin

Nuno Brites
The Startup

--

Asynchronous messaging is a mechanism that allows systems to communicate using messages and without having an immediate response. The messages are published by one system into a queue and then consumed, from the same queue, by another system later in time. The message broker is responsible for the queue and by implementing the messaging protocol.

Message brokers allow distributed applications to become more resilient so that when a request is made to our application backend, and for some reason, it fails to be attended, we can guarantee that it’s not lost forever and that we can re-process it when possible. They also promote decoupling between different parts of our distributed system (e.g. from other services or frontend applications) avoiding the communication point to point, instead, a queue is used to communicate.

In this article, we’ll use a Docker image packed with RabbitMQ as the implementation of the message broker.

RabbitMQ is lightweight and easy to deploy on premises and in the cloud. It supports multiple messaging protocols. RabbitMQ can be deployed in distributed and federated configurations to meet high-scale, high-availability…

--

--

Nuno Brites
The Startup

Software engineer driven by curiosity, writing about software development and tech ✏️ 🚀