RabbitMQ topology guide

Mikhail Potter
4 min readApr 30, 2023

I haven’t thought that it would be that hard to find any guidance on RabbitMQ exchanges and queues topology on the net. Almost every article or discussion I’ve met touched different aspect of either RabbitMQ server tuning or some vogue suggestions like it depends on the application purpose, load and different kinds of aspects. I understand that RabbitMQ is flexible enough to solve any problem with different kinds of exchanges and bindings and there is no silver bullet. However, when I’ve started working with it, I needed some basic guidance on how to organize microservices communication, e.g. how to create topology, name exchanges, queues, and routing keys and not to create a ball of mud with the grow of application. Here, I want to share my experience and show on a simple example how microservice communication might be organized.

Basics

I do not want to describe all the basics, e.g. what is producer, consumer, exchange, queue, routing key and how they are related to each other. Official documentation describes it in a simple and clear way with good examples. So if you completely new to RabbitMQ, please get familiar with the basics first.

Application

Let’s consider a simple application that imitates a store. Customers can place orders, warehouse should be notified about changes to be able to book or release necessary amount of goods. And we need to gather some statistics on order creation. So we have 3 services that should interact: order, warehouse and statistics.

--

--

Mikhail Potter

I have started making software since 2009. Mostly, backends that use JVM stack. However, touched other areas, like mobile, frontend and game development.