This project demonstrates an advanced implementation of RabbitMQ for asynchronous messaging in a Spring Boot application. Designed with scalability and efficiency in mind, it allows for robust message handling in distributed systems, ensuring reliable communication between microservices.
- Asynchronous messaging with RabbitMQ
- Integration with Spring Boot and JPA for database operations
- Dynamic routing using topic exchanges
- Serializable object messaging
- Error handling and message requeueing strategies
- Java 17 or higher
- Maven 3.9.5 or higher
- RabbitMQ Server
- Optional: Docker for containerization
- Clone the repository:
git clone https://github.com/scriptchief/rabbitmq-spring.git
- Navigate to the project directory:
cd rabbitmq-spring
- Build the project with Maven:
mvn clean install
- Start the RabbitMQ server on your local machine or use a Docker container.
- Run the Spring Boot application:
mvn spring-boot:run
The application exposes REST APIs to interact with the RabbitMQ server for CRUD operations on Product
entities.
- Create a Product: Send a POST request to
/api/products
with a product JSON. - Read Product Details: Send a GET request to
/api/products/{id}
. - Update a Product: Send a PUT request to
/api/products/{id}
with the updated product JSON. - Delete a Product: Send a DELETE request to
/api/products/{id}
.
- Producer Service: Handles incoming REST requests and sends messages to RabbitMQ.
- Consumer Service: Listens to RabbitMQ messages and processes them (e.g., database operations).
- RabbitMQ Configuration: Defines queues, exchanges, and bindings.
- Implementing advanced RabbitMQ features like dead-letter exchanges, delayed messaging, and priority queues.
- Adding containerization with Docker and orchestration with Kubernetes.
- Integrating with a frontend framework for a full-stack application.
Contributions to enhance this project are welcome. Please read CONTRIBUTING.md
for guidelines on how to contribute.
This project is licensed under the MIT License - see the LICENSE.md
file for details.
- Developer: Bayram EKER
- Email: [email protected]