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:
attermann
2023-02-12 09:33:14 -07:00
committed by spencergibb
parent 2c9bde3788
commit 9bf9c44f3b

View File

@@ -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);
}