To make your microservices resilient to restart consul you should
- set
spring.cloud.consul.discovery.heartbeat.enabled: true
and - run consul v1.7.1 as
./consul agent -data-dir /var/tmp/consul -advertise 127.0.0.1 -server -bootstrap -ui
- Dig DNS queries
dig @127.0.0.1 -p 8600 foo.service.dc1.consul. +timeout=1 SRV
dig @127.0.0.1 -p 8600 foo.service.consul. +timeout=1 SRV
Test
curl -i 'http://localhost:8282/foo'