Elaborate Microservice async example with FastAPI, RabbitMQ, MongoDB and Redis — part3.

Anders Wiklund
8 min readMar 30, 2023
Image created by the author

Introduction

This is part3 in the series. This part talks about how RabbitMQ is used for response messages and the automatic scaling that is available.

Here’s a brief outline of the article parts:

  1. Introduction and installation of required components.
  2. OrderService Architecture and Design patterns.
  3. OrderService usage of RabbitMQ (this article).
  4. PaymentService Architecture and Design patterns.
  5. FastAPI enhancements.
  6. Putting it all together.

Configuration work needed

Now you have to complete the configuration setup by creating three secrets files. That is a good way to handle passwords or other sinsitive data. Note though, the secrets files should NEVER be put under version control (like in git). That defeats the purpose of secrets.

The location of the files are different depending on your platform. If you are using Windows they are located at:

C:\\Users\\**********\\AppData\\Roaming\\Python\\secrets

--

--