package nakadi;

/**
 * Supports API operations related to health checks.
 */
public class HealthCheckResource {

  private final NakadiClient client;

  public HealthCheckResource(NakadiClient client) {
    this.client = client;
  }

  /**
   * Make a healthcheck requestThrowing to the server. Non-success codes do not result in
   * exceptions - callers should examine the response.
   *
   * @return a http Response
   * @throws NakadiException typically a local or network exception
   */
  public Response healthcheck() throws NakadiException {

    Resource resource = client.resourceProvider().newResource();
    return resource.request("GET",
        UriBuilder.builder(client.baseURI()).path("health").buildString(),
        ResourceSupport.options("*/*").tokenProvider(client.resourceTokenProvider()));
  }

  /**
   * Make a healthcheck requestThrowing to the server. Non-success codes result in
   * exceptions.
   *
   * @return a http Response if successful
   * @throws AuthorizationException
   * @throws ClientException
   * @throws ServerException
   * @throws InvalidException
   * @throws RateLimitException
   * @throws NakadiException
   */
  @SuppressWarnings("JavaDoc") public Response healthcheckThrowing()
      throws AuthorizationException, ClientException, ServerException, InvalidException,
      RateLimitException, NakadiException {

    Resource resource = client.resourceProvider().newResource();
    return resource.requestThrowing("GET",
        UriBuilder.builder(client.baseURI()).path("health").buildString(),
        ResourceSupport.options("*/*").tokenProvider(client.resourceTokenProvider()),
        Response.class);
  }
}

@@ -10,16 +10,55 @@
 akadi;%0A%0A
+import java.util.concurrent.TimeUnit;%0A%0A
 /**%0A * S
@@ -1390,33 +1390,237 @@
 kadiException %7B%0A
+    PolicyBackoff backoff = ExponentialBackoff.newBuilder()%0A        .initialInterval(900, TimeUnit.MILLISECONDS)%0A        .maxAttempts(5)%0A        .maxInterval(6000, TimeUnit.MILLISECONDS)%0A        .build();
 %0A
-
     Resource res
@@ -1691,24 +1691,29 @@
 urce.request
+Retry
 Throwing(%22GE
@@ -1877,16 +1877,16 @@
 der()),%0A
-
         
@@ -1899,16 +1899,25 @@
 se.class
+, backoff
 );%0A  %7D%0A%7D

Use a backoff for throwing healthcheck