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-service
called bycard-service
anduser-service
to 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 RestTemplate
uses 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
CircuitBreakerFactory
via thecreate()
method - HTTP call and fallback method defined
- Circuit breaker configuration modified in
Customizer<CircuitBreaker
bean in a@Configuration
class - 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
@RefreshScope
beans and/actuator/refresh
endpoint
- HTTP traffic monitoring using Micrometer + Prometheus
- Added a Micrometer's
Timer
toVerificationServiceClient