This project demonstrates a full microservices architecture built with Spring Boot and Apache Kafka, enhanced with Docker orchestration and integrated observability using Prometheus and Grafana.
It includes multiple independently-deployable services such as product, order, inventory, notification, etc., along with service discovery, API gateway, and monitoring capabilities — providing a solid foundation for building scalable, distributed backend systems.
- API Gateway — routes incoming requests to the correct microservice.
- Discovery Server — handles service registry and discovery.
- Product Service — manages product catalog and details.
- Order Service — handles customer orders and order processing.
- Inventory Service — tracks product stock levels.
- Notification Service — sends notifications (e.g., order confirmations).
- … [add other services as needed]
Each service is a standalone Spring Boot application, allowing independent deployment and scalability.
- Synchronous calls between services are facilitated via REST (or WebClient / HTTP) where immediate response is required.
- Asynchronous communication and event-driven flows are handled using Apache Kafka — ideal for decoupled operations like order processing, inventory updates, and notifications.
- The project integrates Prometheus (for metrics collection) with Grafana (for dashboards) for monitoring service health, performance, and behavior over time.
- Docker + docker-compose (or your orchestration of choice) simplifies running the full stack locally or in production.
Before running the project locally, make sure you have:
- Java (JDK 17+ recommended)
- Maven or Gradle (depending on how each service is configured)
- Docker & Docker Compose (optional but recommended for full stack setup)
- Apache Kafka (if not using docker-compose to spin up Kafka)
- Prometheus and Grafana (or configured via Docker)
- Clone the repository:
git clone https://github.com/wissamsu/SpringBoot-MicroServices-With-Kafka.git cd SpringBoot-MicroServices-With-Kafka
css Copy code
- (Option A — Docker-based) Spin up all services via Docker Compose:
docker-compose up -d
sql Copy code
This will bring up all microservices, Kafka, Prometheus, and Grafana as configured.
- (Option B — Manual) Build and run each service individually:
- Go into each service directory (e.g.,
product-service) - Build with Maven/Gradle:
mvn clean install
- Run the service:
mvn spring-boot:run
- Once everything is up, use the API gateway to send requests to the system.
- View Prometheus and Grafana dashboards to inspect metrics, logs, and service health (check
Grafana_Dashboard.jsonfor pre-configured dashboard).
Each microservice contains its own configuration (e.g. application.yml or application.properties). Kafka topics and brokers can either use local setup or be configured via Docker Compose.
If using Docker, ensure ports for services, Kafka, Prometheus, and Grafana are correctly exposed and not conflicting on your host machine.
Contributions are welcome! If you’d like to add a new feature, fix a bug, or improve documentation:
- Fork the repository
- Create a new branch (
git checkout -b feature/<your-feature>) - Make your changes and commit (
git commit -m "Add <feature>") - Push to your fork (
git push origin feature/<your-feature>) - Open a Pull Request describing your changes
This project is open‑source. Feel free to use, modify, and share.
Thanks to all contributors and maintainers.
Happy coding & building microservices! 🚀