Creating a RabbitMQ Consumer for the Core App

Learn how to create a RabbitMQ consumer in Flask.

We'll cover the following

After creating the RabbitMQ producer for the Core app, we must also create a RabbitMQ consumer for it.

Creating a consumer in the Core app

To create a RabbitMQ consumer in the Core app, we'll create a file in the backendservice2 app directory folder named consumer.py. Then, we'll open the file and import pika and json, like so:

Get hands-on with 1400+ tech skills courses.