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

Anders Wiklund
10 min readApr 1, 2023
Image created by author

Introduction

This is part5 in the series. This part talks about the OrderService configuration handling, unified logging and OpenAPI documentation enrichment.

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.
  4. PaymentService Architecture and Design patterns.
  5. FastAPI enhancements (this article).
  6. Putting it all together.

Configuration handling

The Pydantic configuration handling is quite powerful. I’m only using a small part of it’s functionality in this example. The flexibility that you get by using config handling is huge. Just think of a scenario where you deploy in a test, stage or production environment. The URL will will most likely differ from your development environment, pointing to other servers and will use other users and passwords to connect. Log levels might differ etc.

If you want to discover more of the capabilities that Pydantic has to offer. I’ve written another Medium article that…

--

--