
Learn RabbitMQ fundamentals and architecture, configure producer, consumer, queues, exchanges, bindings, and routing keys in Spring Boot via Spring AMQP, using string or JSON messages for event-driven microservices.
Explore how RabbitMQ enables asynchronous messaging in microservices by using producers, exchanges, and queues, with brokers routing messages to consumers across services like order, stock, and email.
Explore RabbitMQ core concepts, including producers that send messages to a broker, and consumers that read from it, plus queues, exchanges, routing keys, and bindings.
Discover RabbitMQ architecture with producers, consumers, exchanges, and queues, and how routing keys bind exchanges to queues to route messages. Implement a multi-queue setup in a Spring Boot application.
Pull the RabbitMQ docker image 3.10.5-management from Docker Hub, then run it in a container and expose port 15672 for management and client connections, verifying the image in Docker Desktop.
Explore the RabbitMQ management plugin on port 15672, log in as guest, and create exchange_demo and queue_demo with routing_key_demo. Bind, publish, and verify messages in the queue.
Implement a basic RabbitMQ flow in a Spring Boot app, configuring the queue java_guides, exchange javaguides_exchange, and routing key javaguides_routing_key, and building a string producer and consumer.
Create and set up a Spring Boot project with Spring Initializr, import it into IntelliJ, and run the main entry point to confirm the app on port 8080.
Connect a Spring Boot app to a RabbitMQ broker with auto configuration. Use properties (host localhost, port 5672, guest/guest) and prepare to add a queue, exchange, binding, producer, and consumer.
Configure a Spring Boot app to declare a RabbitMQ queue, topic exchange, and binding with a routing key using configurable properties and Spring beans; auto-configuration handles core infrastructure.
Learn to build a spring boot RabbitMQ producer that sends messages to a configured exchange and routing key using RabbitTemplate, @Value for properties, and constructor-based injection.
Create a simple rest API to publish a message to RabbitMQ using Spring Boot, inject the RabbitMQProducer with constructor-based dependency injection, and verify delivery via RabbitMQ management.
Create a RabbitMQ consumer in a Spring Boot app using @RabbitListener to read messages from a configured queue and log them, verified via a REST call.
Explore using json messages for producer–consumer communication with RabbitMQ, create multiple queues like javaguides_json on a single exchange, and route messages using routing keys.
Configure RabbitMQ to exchange JSON messages between producer and consumer by creating a JSON queue and binding it to an exchange with a routing key in a Spring Boot setup.
Create a RabbitMQ json producer that sends a user object as json to a configured exchange and routing key using RabbitTemplate, with logging and Spring Boot integration.
Spring Boot 3 rest api to send a json object via RabbitMQ, featuring a /api/v1/publish post endpoint, json producer, and queue exchange routing key verification.
Create a RabbitMQ JSON consumer with Spring Boot, use @RabbitListener to read from the javaguides_json queue, log and convert messages to a Java user object.
Explore event-driven architecture, a pattern where decoupled microservices publish and subscribe to events via a message broker, enabling asynchronous communication and loose coupling.
Explore how event-driven microservices use a message broker for asynchronous communication to publish order events to RabbitMQ and deliver them to independent stock and email services, enabling scalability.
Explore event-driven microservices with Spring Boot and RabbitMQ, enabling asynchronous communication between an order service, a stock service, and an email service using an exchange, routing keys, and queues.
Create three independent Spring Boot microservices—order service, stock service, and email service—using Spring Initializr, Spring Boot 3, and Maven with RabbitMQ support, then import them into IntelliJ for development.
Import three Spring Boot microservices as modules into a single IntelliJ IDEA project and run them on ports 8080, 8081, and 8082, ensuring JDK 17 compatibility for Spring Boot.
Configure a Spring Boot order service to add order queue, exchange, and binding with routing key, and enable a Jackson JSON message converter and RabbitTemplate using values from application properties.
Create a RabbitMQ producer in the order service, define order dto and order event, use Lombok to reduce boilerplate, inject RabbitTemplate, and publish order events to a topic exchange.
Create a rest api to place an order, assign a uuid, and emit a pending order event through the order producer to rabbitmq using the order_exchange and order_routing_key.
Configure the stock service to consume order events using existing DTOs and RabbitMQ config, with a JSON message converter, and verify by running the stock service.
Create a RabbitMQ consumer in the stock service to read order events. Annotate with @RabbitMQListener, log events, and verify end-to-end message flow from the order queue.
Configure the email queue in the order service with RabbitMQ, set routing keys and bindings to route order events via exchange to the email queue, and enable JSON message conversion.
Explore configuring RabbitMQ queues and routing keys in a Spring Boot 3 order service, and implement sending events to the order and email queues via the exchange and RabbitTemplate.
Configure RabbitMQ in email service to consume order events from email queue using a JSON message converter and RabbitTemplate, and implement an order consumer with RabbitListener to log events.
Run three microservices and showcase their communication via RabbitMQ. Observe order, stock, and email services publishing and consuming events with auto-created queues and verifiable bindings.
In this course, you will learn:
- How to build RabbitMQ Producer and Consumer to exchange different formats of data such as String and JSON. - How to use RabbitMQ as a message broker for Async communication between multiple Microservices (Event-Driven Architecture).
In this course, we are going to use Spring boot 3 latest release. If you want to use RabbitMQ in Spring boot event-driven microservices then this course is useful for you.
What is the Spring Boot?
Spring Boot is an extension of the Spring framework that eliminated the boilerplate configurations required for setting up a Spring application.
Spring Boot is an opinionated framework that helps developers build Spring-based applications quickly and easily. The main goal of Spring Boot is to quickly create Spring-based applications without requiring developers to write the same boilerplate configuration again and again.
What is RabbitMQ?
RabbitMQ is an open-source message broker software. It accepts messages from producers and delivers them to consumers. It acts like a middleman which can be used to reduce loads and delivery times taken by web application servers.
RabbitMQ uses Advanced Messaging Queuing Protocol (AMQP) for the secure transfer of messages.
Use of RabbitMQ in Microservices
RabbitMQ is one of the simplest freely available options for implementing messaging queues in your microservices architecture. These queue patterns can help to scale your application by communicating between various microservices. We can use these queues for various purposes, such as the interaction between core microservices, decoupling of microservices, implementing failover mechanisms, and sending email notifications via message brokers.
What is event-driven architecture?
Event-driven architecture (EDA) is a software design pattern in which decoupled applications can asynchronously publish and subscribe to events via an event broker/message broker.
In an Event-Driven Architecture, applications communicate with each other by sending and/or receiving events or messages
What you will learn?
Learn RabbitMQ Core Concepts
Learn how to integrate RabbitMQ in the Spring boot application
Learn how to create RabbitMQ Queue, Exchange, Binding, Producer, and Consumer
Learn how to exchange string messages between Producer and Consumer using the RabbitMQ broker
Learn how to create Multiple Queues in the RabbitMQ broker
Learn how to exchange JSON messages between Producer and Consumer using the RabbitMQ broker
Learn how to create Event-Drive Microservices using Spring boot and RabbitMQ
Learn how to use RabbitMQ as a Message broker for Async communication between multiple Microservices
Tools and Technologies used in this course:
Technologies:
Java 17+
Spring Boot 3+
Tomcat
Messaging Broker:
RabbitMQ
IDE:
Intellij IDEA
Tools:
Postman - Test REST APIs
Maven - Build Tool