Skip to content

Commit

Permalink
Change method to PUT for Consul health check update according to hash…
Browse files Browse the repository at this point in the history
  • Loading branch information
andriisabitov committed Mar 7, 2018
1 parent aabb339 commit 504c902
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.sixt.service.framework.registry.consul.RegistrationManager;
import org.eclipse.jetty.client.HttpClient;
import org.eclipse.jetty.client.api.ContentResponse;
import org.eclipse.jetty.http.HttpMethod;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -109,7 +110,7 @@ private void reportCurrentStatus() {
//TODO: specific to consul; need to refactor
public void updateHealthStatus(HealthCheck.Status status) throws Exception {
logger.trace("Updating health of {}", serviceProps.getServiceName());
ContentResponse httpResponse = httpClient.newRequest(getHealthCheckUri(status)).send();
ContentResponse httpResponse = httpClient.newRequest(getHealthCheckUri(status)).method(HttpMethod.PUT).send();
if (httpResponse.getStatus() != 200) {
logger.warn("Received {} trying to update health", httpResponse.getStatus());
}
Expand Down

0 comments on commit 504c902

Please sign in to comment.