Skip to content

Instantly share code, notes, and snippets.

@eldermoraes
Created July 13, 2020 14:30
Show Gist options
  • Save eldermoraes/5c12dc31ad703b9deec17428bff2af2e to your computer and use it in GitHub Desktop.
Save eldermoraes/5c12dc31ad703b9deec17428bff2af2e to your computer and use it in GitHub Desktop.
@Readiness
public class ReadinessCheck implements HealthCheck {
@Override
public HealthCheckResponse call() {
Client client = ClientBuilder.newClient();
Response response = client.target("https://eldermoraes.com").request().get();
if (response.getStatusInfo().getFamily().equals(Response.Status.Family.SUCCESSFUL)){
return HealthCheckResponse.up("I'm ready!");
} else{
return HealthCheckResponse.down("I'm not ready yet...");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment