public final class HealthCheckedEndpointGroupBuilder extends AbstractHealthCheckedEndpointGroupBuilder
HealthCheckedEndpointGroup that sends HTTP health check requests.| Modifier and Type | Method and Description |
|---|---|
HealthCheckedEndpointGroupBuilder |
clientFactory(ClientFactory clientFactory)
Sets the
ClientFactory to use when making health check requests. |
HealthCheckedEndpointGroupBuilder |
clientOptions(ClientOptions options)
Sets the
ClientOptions of the Client that sends health check requests. |
HealthCheckedEndpointGroupBuilder |
healthCheckPort(int port)
Deprecated.
|
HealthCheckedEndpointGroupBuilder |
maxEndpointCount(int maxEndpointCount)
Sets the maximum endpoint count of target selected candidates.
|
HealthCheckedEndpointGroupBuilder |
maxEndpointRatio(double maxEndpointRatio)
Sets the maximum endpoint ratio of target selected candidates.
|
protected Function<? super HealthCheckerContext,? extends AsyncCloseable> |
newCheckerFactory()
Returns the
Function that starts to send health check requests to the Endpoint
specified in a given HealthCheckerContext when invoked. |
HealthCheckedEndpointGroupBuilder |
port(int port)
Sets the port where a health check request will be sent instead of the original port number
specified by
EndpointGroup's Endpoints. |
HealthCheckedEndpointGroupBuilder |
protocol(SessionProtocol protocol)
Sets the
SessionProtocol to be used when making health check requests. |
HealthCheckedEndpointGroupBuilder |
retryBackoff(Backoff retryBackoff)
Sets the backoff between health check requests.
|
HealthCheckedEndpointGroupBuilder |
retryInterval(Duration retryInterval)
Sets the interval between health check requests.
|
HealthCheckedEndpointGroupBuilder |
useGet(boolean useGet)
Sets whether to use HTTP
GET method instead of HEAD when sending a health check request. |
HealthCheckedEndpointGroupBuilder |
withClientOptions(Function<? super ClientOptionsBuilder,ClientOptionsBuilder> configurator)
|
build, retryIntervalMillispublic HealthCheckedEndpointGroupBuilder useGet(boolean useGet)
GET method instead of HEAD 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.public HealthCheckedEndpointGroupBuilder clientFactory(ClientFactory clientFactory)
AbstractHealthCheckedEndpointGroupBuilderClientFactory to use when making health check requests. This should generally be the
same as the ClientFactory used when creating a Client stub using the
EndpointGroup.clientFactory in class AbstractHealthCheckedEndpointGroupBuilderpublic HealthCheckedEndpointGroupBuilder protocol(SessionProtocol protocol)
AbstractHealthCheckedEndpointGroupBuilderSessionProtocol to be used when making health check requests.protocol in class AbstractHealthCheckedEndpointGroupBuilder@Deprecated public HealthCheckedEndpointGroupBuilder healthCheckPort(int port)
AbstractHealthCheckedEndpointGroupBuilderEndpointGroup's Endpoints. This property is useful when your
server listens to health check requests on a different port.healthCheckPort in class AbstractHealthCheckedEndpointGroupBuilderpublic HealthCheckedEndpointGroupBuilder port(int port)
AbstractHealthCheckedEndpointGroupBuilderEndpointGroup's Endpoints. This property is useful when your
server listens to health check requests on a different port.port in class AbstractHealthCheckedEndpointGroupBuilderpublic HealthCheckedEndpointGroupBuilder retryInterval(Duration retryInterval)
AbstractHealthCheckedEndpointGroupBuilderretryInterval in class AbstractHealthCheckedEndpointGroupBuilderpublic HealthCheckedEndpointGroupBuilder retryBackoff(Backoff retryBackoff)
AbstractHealthCheckedEndpointGroupBuilderretryBackoff in class AbstractHealthCheckedEndpointGroupBuilderpublic HealthCheckedEndpointGroupBuilder clientOptions(ClientOptions options)
AbstractHealthCheckedEndpointGroupBuilderClientOptions of the Client that sends health check requests.
This method can be useful if you already have an Armeria client and want to reuse its configuration,
such as using the same decorators.
WebClient myClient = ...;
// Use the same settings and decorators with `myClient` when sending health check requests.
builder.clientOptions(myClient.options());
clientOptions in class AbstractHealthCheckedEndpointGroupBuilderpublic HealthCheckedEndpointGroupBuilder withClientOptions(Function<? super ClientOptionsBuilder,ClientOptionsBuilder> configurator)
AbstractHealthCheckedEndpointGroupBuilderFunction that customizes a Client that sends health check requests.
builder.withClientOptions(b -> {
return b.setHttpHeader(HttpHeaders.AUTHORIZATION,
"bearer my-access-token")
.responseTimeout(Duration.ofSeconds(3));
});
withClientOptions in class AbstractHealthCheckedEndpointGroupBuilderprotected Function<? super HealthCheckerContext,? extends AsyncCloseable> newCheckerFactory()
AbstractHealthCheckedEndpointGroupBuilderFunction that starts to send health check requests to the Endpoint
specified in a given HealthCheckerContext when invoked. The Function must update
the health of the Endpoint with a value between [0, 1] via
HealthCheckerContext.updateHealth(double). HealthCheckedEndpointGroup will call
AsyncCloseable.closeAsync() on the AsyncCloseable returned by the Function
when it needs to stop sending health check requests.newCheckerFactory in class AbstractHealthCheckedEndpointGroupBuilderpublic HealthCheckedEndpointGroupBuilder maxEndpointRatio(double maxEndpointRatio)
AbstractHealthCheckedEndpointGroupBuildermaxEndpointRatio in class AbstractHealthCheckedEndpointGroupBuilderPartialHealthCheckStrategyBuilder.maxEndpointRatio(double)public HealthCheckedEndpointGroupBuilder maxEndpointCount(int maxEndpointCount)
AbstractHealthCheckedEndpointGroupBuildermaxEndpointCount in class AbstractHealthCheckedEndpointGroupBuilderPartialHealthCheckStrategyBuilder.maxEndpointCount(int)Copyright © 2020 LeanCloud. All rights reserved.