From 504c9023be50ba3f0b5594bf22439002d8c0f648 Mon Sep 17 00:00:00 2001 From: Andrii Sabitov Date: Wed, 7 Mar 2018 13:50:57 +0100 Subject: [PATCH] Change method to PUT for Consul health check update according to https://github.com/hashicorp/consul/pull/3405 --- .../com/sixt/service/framework/health/HealthCheckManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sixt/service/framework/health/HealthCheckManager.java b/src/main/java/com/sixt/service/framework/health/HealthCheckManager.java index 8c72cdd..d2bee85 100644 --- a/src/main/java/com/sixt/service/framework/health/HealthCheckManager.java +++ b/src/main/java/com/sixt/service/framework/health/HealthCheckManager.java @@ -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; @@ -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()); }