@ Override protected void deregister ( ServiceInstance instance ) { if ( instance . getInstanceId ( ) . isPresent ( ) ) { DeregisterInstanceRequest deregisterInstanceRequest = new DeregisterInstanceRequest ( ) . withServiceId ( route53AutoRegistrationConfiguration . getAwsServiceId ( ) ) . withInstanceId ( instance . getInstanceId ( ) . get ( ) ) ; getDiscoveryClient ( ) . deregisterInstance ( deregisterInstanceRequest ) ; } }
shutdown instance if it fails health check can gracefully stop .