consul-client icon indicating copy to clipboard operation
consul-client copied to clipboard

Add automatic deregistration option

Open zhanazhan opened this issue 8 years ago • 3 comments

Added deregistration option when service is failing, greatly helps when service was killed with -9 option.

If you guys want to update Registration class, here is the change.

Registration.java.txt

zhanazhan avatar May 12 '17 09:05 zhanazhan

Do we need to add https://github.com/OrbitzWorldwide/consul-client/pull/168 in another spot?

jplock avatar May 30 '17 18:05 jplock

Make a PR and I'll merge it

rickfast avatar Jun 01 '17 18:06 rickfast

This already exists. Consul keeps track of this timer for health checks, not service instances. You can add a deregisterCriticalServiceAfter to any health check:

Registration.RegCheck deadManSwitch = ImmutableRegCheck.builder()
		.ttl("10s")
		.deregisterCriticalServiceAfter("3h")
		.build();

alugowski avatar Jul 29 '17 00:07 alugowski