This branch contains the demo with Spring Cloud Netflix Eureka. To see the same demo with other service registries, see the other branches.
After running all the apps execute POST at localhost:9080/application passing
cardApplication.json as body.
http POST localhost:9080/application < cardApplication.json- new card applications registered via
card-service - user registered via
user-service fraud-servicecalled bycard-serviceanduser-serviceto verify card applications and new users
+-------+ +-------------+ +-------------+ +-------+ +---------------+ +-------+
| User | | CardService | | UserService | | Proxy | | FraudVerifier | | Proxy |
+-------+ +-------------+ +-------------+ +-------+ +---------------+ +-------+
| | | | | |
| Register application | | | | |
|----------------------------------->| | | | |
| | | | | |
| | Create new user | | | |
| |------------------------------------------>| | |
| | | | | |
| | | Create new user | | |
| | |<--------------------| | |
| | | | | |
| | | Verify new user | | |
| | |-------------------->| | |
| | | | | |
| | | | Verify new user | |
| | | |------------------------>| |
| | | | | |
| | | | User verified | |
| | | |<------------------------| |
| | | | | |
| | | User verified | | |
| | |<--------------------| | |
| | | | | |
| | User created | | | |
| |<--------------------| | | |
| | | | | |
| | | | | User created |
| |<-----------------------------------------------------------------------------------|
| | | | | |
| | Verify card application | | |
| |-------------------------------------------------------------------->| |
| | | | | |
| | | Card application verified | |
| |<--------------------------------------------------------------------| |
| | | | | |
| Card application registered | | | | |
|<-----------------------------------| | | | |
| | | | | |
@LoadBalanced RestTemplateuses Spring Cloud LoadBalancer under the hood
- Routes have to be explicitly defined
- Possibility to configure routes either via properties or Java configuration
- All headers passed by default
- Routes matched using predicates, requests modified using filters
- Interactions defined using injected
CircuitBreakerFactoryvia thecreate()method - HTTP call and fallback method defined
- Circuit breaker configuration modified in
Customizer<CircuitBreakerbean in a@Configurationclass - Resilience4J used underneath
- card-service connects to ConfigServer to retrieve property values
- ConfigServer backed by a git repository
- Updating property values in a running application by using
@RefreshScopebeans and/actuator/refreshendpoint
- HTTP traffic monitoring using Micrometer + Prometheus
- Added a Micrometer's
TimertoVerificationServiceClient