Member-only story

Simple Pub-Sub implementation with Spring Boot, Docker, and RabbitMQ

How to set up a simple pub-sub with manual acknowledgment

Yanneck Reiß
6 min readFeb 8, 2021
Photo by Joel Holland on Unsplash

In this tutorial, I want to show you how you can easily set up RabbitMQ with docker and integrate it into your Spring application to easily implement a pub-sub procedure.

Note: In order to follow this tutorial, you should have some basic knowledge in setting up a Spring Boot application and know how to run a Docker container.

Publish-Subscribe-Pattern

First, let’s start with some quick fundamentals about the Publish-Subscribe-Pattern. The pattern is very simple but powerful. The following image shows the main concept:

Publish-Subscribe-Pattern

We have two actors in this pattern:

  • Publisher: Asynchronously sends messages to the queue without worrying about who exactly processes the respective message.
  • Subscriber: Subscribes to specific topics or a specific queue and consumes incoming messages.

Acknowledgment

--

--

Yanneck Reiß
Yanneck Reiß

Written by Yanneck Reiß

Follow me on my journey as a professional mobile and fullstack developer

No responses yet