From deca3440228546b58c61eef84d874051eedd8b3c Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Tue, 15 Oct 2024 17:19:01 +0200 Subject: [PATCH] updated UriResolverHealthCheck --- .../resolver/services/UriResolverHealthCheck.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/gcube/datatransfer/resolver/services/UriResolverHealthCheck.java b/src/main/java/org/gcube/datatransfer/resolver/services/UriResolverHealthCheck.java index 68f61cf..d80f10b 100644 --- a/src/main/java/org/gcube/datatransfer/resolver/services/UriResolverHealthCheck.java +++ b/src/main/java/org/gcube/datatransfer/resolver/services/UriResolverHealthCheck.java @@ -5,6 +5,9 @@ import java.util.Optional; import javax.ws.rs.GET; import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; import org.eclipse.microprofile.health.HealthCheck; import org.eclipse.microprofile.health.HealthCheckResponse; @@ -19,14 +22,22 @@ import org.eclipse.microprofile.health.HealthCheckResponse; @Path("health") public class UriResolverHealthCheck implements HealthCheck { + @GET + @Path("") + @Produces({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON }) + public Response check() { + + HealthCheckResponse hcr = call(); + + return Response.ok().entity(hcr).build(); + } + /** * Call. * * @return the health check response */ @Override - @GET - @Path("") public HealthCheckResponse call() { // return HealthCheckResponse.named("uri-resolver").up().build();