Added status code 404 to ReregistrationPredicate
Consul agent as of approximately v1.11.2 returns status code 404 on agent health check instead of status code 500. This change resulted in re-registration not taking place when expected. Adding status code 404 to the ReregistrationPredicate enables re-registration with both older and newer versions of Consul agent. Fixes gh-808
This commit is contained in:
@@ -33,8 +33,8 @@ public interface ReregistrationPredicate {
|
||||
boolean isEligible(OperationException e);
|
||||
|
||||
/**
|
||||
* Default implementation that performs re-registration when the status code is 500.
|
||||
* Default implementation that performs re-registration when the status code is either 404 or 500.
|
||||
*/
|
||||
ReregistrationPredicate DEFAULT = e -> e.getStatusCode() == 500;
|
||||
ReregistrationPredicate DEFAULT = e -> (e.getStatusCode() == 404 || e.getStatusCode() == 500);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user