docker pull consul
docker run -d --name=c1 -p 8500:8500 consul agent -dev -client=0.0.0.0 -bind=0.0.0.0
http://localhost:8500
(Currently the projects use the configuration of consul) in key/value add this property
key or folder = config/export-service/test
value = ANY_VALUE
- config:base path
- export-service: Service name
- test: Property
in projects it is used like this
@Value("${test}")
String value;
If you want run Consul in another location, check bootstrap.yml in both projects(api-gateway, export-service) and configure the host and port
(run in port 9000, check health in consul dashboard)
check zuul configuration in application.yml
(run in port 8000, check health in consul dashboard)
exec with vm option
-Dserver.port=8001
(run in port 8001, check health in consul dashboard)
http://localhost:9000/export-service/hola-mundo
If both instances are running correctly, the port shown in each request must change(8000,8001)
- Api-Gateway: http://localhost:9000/actuator/hystrix.stream
- export-service1: http://localhost:8000/actuator/hystrix.stream
- export-service2: http://localhost:8001/actuator/hystrix.stream
check with any hystrix stream
- export-service1: http://localhost:8000/fault
- export-service2: http://localhost:8001/fault
(check in hystrix dashboard with export-service1 or export-service2 stream)