updated UriResolverHealthCheck
This commit is contained in:
parent
e2b0020484
commit
deca344022
|
@ -5,6 +5,9 @@ import java.util.Optional;
|
||||||
|
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
import javax.ws.rs.Path;
|
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.HealthCheck;
|
||||||
import org.eclipse.microprofile.health.HealthCheckResponse;
|
import org.eclipse.microprofile.health.HealthCheckResponse;
|
||||||
|
@ -19,14 +22,22 @@ import org.eclipse.microprofile.health.HealthCheckResponse;
|
||||||
@Path("health")
|
@Path("health")
|
||||||
public class UriResolverHealthCheck implements HealthCheck {
|
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.
|
* Call.
|
||||||
*
|
*
|
||||||
* @return the health check response
|
* @return the health check response
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@GET
|
|
||||||
@Path("")
|
|
||||||
public HealthCheckResponse call() {
|
public HealthCheckResponse call() {
|
||||||
// return HealthCheckResponse.named("uri-resolver").up().build();
|
// return HealthCheckResponse.named("uri-resolver").up().build();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue