Package io.smallrye.health.checks
Class UrlHealthCheck
java.lang.Object
io.smallrye.health.checks.UrlHealthCheck
- All Implemented Interfaces:
org.eclipse.microprofile.health.HealthCheck
Health check implementation to check if host is reachable using a Http URL connection.
@Produces
@ApplicationScoped
@Liveness
HealthCheck check1() {
return new UrlHealthCheck("www.google.com");
}
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.microprofile.health.HealthCheckResponsecall()Sets the name of the health check.requestMethod(String requestMethod) Sets the request method to be used (ie GET, POST, PUT, ...)statusCode(int statusCode) Sets the expected status code to be returned as valid.timeout(int timeout) Sets timeout in millis.
-
Constructor Details
-
UrlHealthCheck
-
-
Method Details
-
call
public org.eclipse.microprofile.health.HealthCheckResponse call()- Specified by:
callin interfaceorg.eclipse.microprofile.health.HealthCheck
-
name
Sets the name of the health check.- Parameters:
name- of health check.- Returns:
- UrlHealthCheck instance.
-
timeout
Sets timeout in millis.- Parameters:
timeout- in millis.- Returns:
- UrlHealthCheck instance.
-
statusCode
Sets the expected status code to be returned as valid.- Parameters:
statusCode- expected.- Returns:
- UrlHealthCheck instance.
-
requestMethod
Sets the request method to be used (ie GET, POST, PUT, ...)- Parameters:
requestMethod- to use.- Returns:
- UrlHealthCheck instance.
-