This microservice provides the 'hello' functionality exposed by REST endpoints.
Application supports distributed tracing(Spring Cloud Sleuth, Zipkin) and OpenAPI Specification standard.
Additionally, application implements 'Circuit Breaker' pattern using Netflix Hystrix library.
- Running config-server.
- Running service-registry.
- Running zipkin server.
- Running admin-dashboard.
- Running user-service.
Start application:
./gradlew bootRun
-
Start service.
-
Open 'hello-service' OpenAPI ui.
-
Check client side load balancing using 'hello-controller'.
-
Check if application successfully registered in service-registry.
-
Play with hystrix:)
# Simulate hystrix failure curl "http://localhost:8080/hello/hystrix?shouldFail=true" # Simulate hystrix success curl "http://localhost:8080/hello/hystrix?shouldFail=false" # Get 'Hello' endpoint is also behind Circut Breaker curl "http://localhost:8080/hello"
-
Check Hystrix dashboard:
- Go to admin-dashboard.
- Choose 'hello-service' application.
- Click Hystrix tab.
- Simulate traffic in hello-service
-
Open zipkin ui and investigate traces.
# Clean build jar
./gradlew clean build
# Build docker image
./gradlew jibDockerBuild
Name | Endpoint |
---|---|
Hello Service |
http://localhost:8080/ |
Swagger UI |
http://localhost:8080/swagger-ui.html |
Swagger api-docs |
http://localhost:8080/v3/api-docs |
Actuator - Hystrix Stream |
http://localhost:8080/actuator/hystrix.stream |