Class HealthCheckedEndpointGroupBuilder
java.lang.Object
com.linecorp.armeria.client.endpoint.AbstractDynamicEndpointGroupBuilder<HealthCheckedEndpointGroupBuilder>
com.linecorp.armeria.client.endpoint.healthcheck.AbstractHealthCheckedEndpointGroupBuilder<HealthCheckedEndpointGroupBuilder>
com.linecorp.armeria.client.endpoint.healthcheck.HealthCheckedEndpointGroupBuilder
- All Implemented Interfaces:
DynamicEndpointGroupSetters<HealthCheckedEndpointGroupBuilder>
public final class HealthCheckedEndpointGroupBuilder
extends AbstractHealthCheckedEndpointGroupBuilder<HealthCheckedEndpointGroupBuilder>
A builder for creating a new
HealthCheckedEndpointGroup
that sends HTTP health check requests.-
Method Summary
Modifier and TypeMethodDescriptionprotected Function
<? super HealthCheckerContext, ? extends AsyncCloseable> Returns theFunction
that starts to send health check requests to theEndpoint
specified in a givenHealthCheckerContext
when invoked.useGet
(boolean useGet) Sets whether to use HTTPGET
method instead ofHEAD
when sending a health check request.Methods inherited from class com.linecorp.armeria.client.endpoint.healthcheck.AbstractHealthCheckedEndpointGroupBuilder
auth, build, clientFactory, clientOptions, maxEndpointCount, maxEndpointRatio, port, protocol, retryBackoff, retryInterval, retryIntervalMillis, selectionTimeout, selectionTimeout, selectionTimeoutMillis, selectionTimeoutMillis, withClientOptions
Methods inherited from class com.linecorp.armeria.client.endpoint.AbstractDynamicEndpointGroupBuilder
allowEmptyEndpoints, selectionTimeoutMillis, self, shouldAllowEmptyEndpoints
-
Method Details
-
useGet
Sets whether to use HTTPGET
method instead ofHEAD
when sending a health check request. By default,HEAD
method is used. This can be useful when the health check requests are failing due to a bad request or an authorization failure and you want to learn why. -
newCheckerFactory
Description copied from class:AbstractHealthCheckedEndpointGroupBuilder
Returns theFunction
that starts to send health check requests to theEndpoint
specified in a givenHealthCheckerContext
when invoked. TheFunction
must update the health of theEndpoint
with a value between [0, 1] viaHealthCheckerContext.updateHealth(double, ClientRequestContext, ResponseHeaders, Throwable)
.HealthCheckedEndpointGroup
will callAsyncCloseable.closeAsync()
on theAsyncCloseable
returned by theFunction
when it needs to stop sending health check requests.- Specified by:
newCheckerFactory
in classAbstractHealthCheckedEndpointGroupBuilder<HealthCheckedEndpointGroupBuilder>
-