This demo shows how a Spring Boot 2 microservice consumes from a Kafka topic and uses the fault tolerance library Resilience4j to isolate from fails in mongoDb database.
See Resilience4j User Guide for more details.
To run the complete Demo application, just run the 01-start.sh bash script.
./01-start.sh
This script will:
- Start the docker machine on your local machine,
- Build the application image
- Start the docker images
- Display the application logs
To stop the Demo application, just run:
./02-stop.sh
The provided docker-compose file will deploy the following things in your local machine:
- Swagger documentation page
- Prometheus metrics UI
- Grafana with Resilience4j and Kafka Dashboards. (User: admin, Password: root)
Docker and Docker Compose installed.
For further reference, please consider the following sections:
- Official Gradle documentation
- Spring Boot Gradle Plugin Reference Guide
- Create an OCI image
- Resilience4J
- Apache Kafka Streams Support
- Apache Kafka Streams Binding Capabilities of Spring Cloud Stream
- Spring Web
- Monitoring Circuit breaker with prometheus and grafana
- Monitoring Kafka with prometheus and grafana
The following guides illustrate how to use some features concretely:
- Samples for using Apache Kafka Streams with Spring Cloud stream
- Building a RESTful Web Service
- Serving Web Content with Spring MVC
- Building REST services with Spring
These additional references should also help you: