- pool-service with PoolRepository created using
@RepositoryRestResource
- postgres
- Spring Cloud configuration server with git-based backend
- pool-service connects to configuration-server on boot time and loads available configuration based on
spring.profiles.activeproperty (e.g.java -Dspring.profiles.active=dev -jar target\pool-service-0.0.1-SNAPSHOT.jar)
- configuration-server looks for configuration on git (at configuration directory)
- while using
@RefreshScopeannotation, Spring Boot Actuator adds/refreshendpoint to refresh the service and reread the configuration form configuration-server - applied in pool-service and results-service
pool-serviceandresult-serviceregister themselves in discovery service
- check
PoolVotesFeignClient - example of reading collection from _embedded HAT+JSON using
CollectionModel
Check current state at /actuator/health.
Patterns are configured in results-service.
- ✅ Retry
- ✅ Circuit Breaker
- ✅ Rate Limiter
- ✅ Bulkhead
- ✅ Fallback
- 🔜 Cache
- ✅ locally on Docker Compose - build_and_start_compose.sh
- ✅ locally on Kubernetes (minikube) - build_and_start_kubernetes.sh
- 🔜 on AWS services
- pool-service has in its
pom.xmlspring-boot-starter-actuatordependency, so pool-service status can be retrieved from/actuator/health
- ✅ Docker Compose health checks
- ✅ Kubernetes health checks
- gateway-server as reverse proxy for all services registered in discovery-service
Run the whole solution on localhost using single script:
bash build_and_start_compose.shif you have already built services' jars, then you can skip build part and just start docker compose:
bash start_compose.shIf you have installed kubernetes and already have running minikube cluster, then you can start the solution using:
bash build_and_start_kubernetes.shIt will compile jar file for each service, build docker image available for the minikube cluster and deploy services on the cluster.
Then you can use this script to just start services:
bash start_kubernetes.shTo stop them use:
bash stop_kubernetes.shGateway server will be exposed on minikube IP (which you can check by typing minikube ip in your terminal), e.g.:
curl 172.21.58.62:8072/actuator/health
If you wish to use this repository as your next project starter, remember to extract each service to its own repository. Here, all services (and configuration) are in single git repository to simplify the example.