This is a template Spring Boot microservice implemented using Spring Boot 3.3 and Java 21. It demonstrates the integration of various technologies and best practices for building microservices. Additionally, it showcases the usage of the Common Library.
{PN}
- project name or project name abbreviation
Note: This repository does not represent real-world business scenarios; the examples are solely intended to demonstrate the usage of various technologies.
This template integrates multiple tools and frameworks, including:
- Docker Compose - For containerized dependencies.
- PostgreSQL - Relational database.
- Liquibase - Database migration tool for PostgreSQL.
- MongoDB - NoSQL database.
- Mongock - Database migration tool for MongoDB.
- Redis - In-memory caching system.
- RabbitMQ - Message broker for event-driven communication.
- ShedLock - Ensures scheduled tasks run in distributed environments.
- Logstash/Logback - Centralized logging.
- Checkstyle - Code style enforcement.
- OpenFeign - Declarative REST client.
- OpenTelemetry - Observability and distributed tracing.
- JUnit 5 - Unit testing framework.
- ArchUnit - Architecture rule validation.
- Java 21
- Gradle
- Docker & Docker Compose
Before running the application, start required dependencies using Docker Compose:
docker-compose up
This will create PostgreSQL, MongoDB, Redis, RabbitMQ, and Jaeger containers.
The springboot-microservice-common-lib dependency is not yet available in a central repository. To use it, you need to pull it from the GitHub package repository, which requires a GPR_TOKEN. Since this token is private and user-specific, it cannot be shared in this repository.
To include the dependency locally, follow these steps:
- Clone the
springboot-microservice-common-lib
repository:git clone https://github.com/mmushfiq/springboot-microservice-common-lib.git
- Navigate to the cloned directory:
cd springboot-microservice-common-lib
- Publish the library to your local Maven repository using Gradle:
./gradlew publishToMavenLocal
After completing these steps, the dependency will be available in your local Maven repository and can be used by this microservice.
Run the application with the local
profile. You can do this via IntelliJ IDEA run configurations or using the Gradle command:
./gradlew bootRun --args='--spring.profiles.active=local'
Swagger UI is available at:
http://localhost:8080/swagger-ui.html
- RabbitMQ UI - Monitor queues: http://localhost:15672
- Jaeger UI - View tracing data: http://localhost:16686
This project is licensed under the Apache-2.0 License.