Building message-driven transactions using RabbitMQ
RabbitMQ is a lightweight asynchronous message broker that supports multiple messaging protocols such as AMQP, STOM, WebSocket, and MQTT. It requires erlang before it works properly in Windows, Linux, or macOS. Its installer can be downloaded from https://www.rabbitmq.com/download.html.
Creating the Celery instance
Instead of using Redis as the broker, RabbitMQ is a better replacement as a message broker that will mediate messages between the client and the Celery worker threads. For multiple tasks, RabbitMQ can command the Celery worker to work on these tasks one at a time. The RabbitMQ broker is good for huge messages and it saves these messages to disk memory.
To start, we need to set up a new Celery instance that will utilize the RabbitMQ message broker using its guest account. We will use the AMQP protocol as the mechanism for a producer/consumer type of messaging setup. Here is the snippet that will replace the previous...