| Package | Description |
|---|---|
| com.linecorp.armeria.client |
Client core.
|
| com.linecorp.armeria.client.circuitbreaker |
Failure detection and fallback mechanism based on
circuit breaker pattern.
|
| com.linecorp.armeria.client.encoding |
HTTP content decoding client.
|
| com.linecorp.armeria.client.endpoint |
Endpoint groups and their registry. |
| com.linecorp.armeria.client.limit |
Limits the number of executed
Requests. |
| com.linecorp.armeria.client.retry |
A
Client decorator that handles failures and retries requests. |
| com.linecorp.armeria.internal |
Various classes used internally.
|
| Modifier and Type | Class and Description |
|---|---|
class |
ClientRequestContextWrapper
Wraps an existing
ClientRequestContext. |
class |
DefaultClientRequestContext
Default
ClientRequestContext implementation. |
| Modifier and Type | Method and Description |
|---|---|
ClientRequestContext |
ClientRequestContextBuilder.build()
Returns a new
ClientRequestContext created with the properties of this builder. |
static ClientRequestContext |
ClientRequestContext.current()
Returns the client-side context of the
Request that is being handled in the current thread. |
static ClientRequestContext |
ClientRequestContext.currentOrNull()
Returns the client-side context of the
Request that is being handled in the current thread. |
default ClientRequestContext |
ClientRequestContext.newDerivedContext(RequestId id,
HttpRequest req,
RpcRequest rpcReq)
Creates a new
ClientRequestContext whose properties and Attributes are copied from this
ClientRequestContext, except having a different Request and its own RequestLog. |
ClientRequestContext |
DefaultClientRequestContext.newDerivedContext(RequestId id,
HttpRequest req,
RpcRequest rpcReq,
Endpoint endpoint) |
ClientRequestContext |
ClientRequestContextWrapper.newDerivedContext(RequestId id,
HttpRequest req,
RpcRequest rpcReq,
Endpoint endpoint) |
ClientRequestContext |
ClientRequestContext.newDerivedContext(RequestId id,
HttpRequest req,
RpcRequest rpcReq,
Endpoint endpoint)
Creates a new
ClientRequestContext whose properties and Attributes are copied from this
ClientRequestContext, except having different Request, Endpoint and its own
RequestLog. |
static ClientRequestContext |
ClientRequestContext.of(HttpRequest request)
Returns a new
ClientRequestContext created from the specified HttpRequest. |
static ClientRequestContext |
ClientRequestContext.of(RpcRequest request,
String uri)
Returns a new
ClientRequestContext created from the specified RpcRequest and URI. |
static ClientRequestContext |
ClientRequestContext.of(RpcRequest request,
URI uri)
|
| Modifier and Type | Method and Description |
|---|---|
HttpResponse |
HttpClient.execute(ClientRequestContext ctx,
HttpRequest req) |
O |
Client.execute(ClientRequestContext ctx,
I req)
|
RpcResponse |
RpcClient.execute(ClientRequestContext ctx,
RpcRequest req) |
HttpResponse |
DecoratingHttpClientFunction.execute(HttpClient delegate,
ClientRequestContext ctx,
HttpRequest req)
|
RpcResponse |
DecoratingRpcClientFunction.execute(RpcClient delegate,
ClientRequestContext ctx,
RpcRequest req)
|
Endpoint |
Endpoint.resolve(ClientRequestContext ctx)
Resolves this endpoint into a host endpoint associated with the specified
ClientRequestContext. |
| Modifier and Type | Method and Description |
|---|---|
protected O |
UserClient.execute(io.netty.channel.EventLoop eventLoop,
Endpoint endpoint,
HttpMethod method,
String path,
String query,
String fragment,
I req,
BiFunction<ClientRequestContext,Throwable,O> fallback)
Executes the specified
Request via AbstractUnwrappable.delegate(). |
protected O |
UserClient.execute(HttpMethod method,
String path,
String query,
String fragment,
I req,
BiFunction<ClientRequestContext,Throwable,O> fallback)
Executes the specified
Request via AbstractUnwrappable.delegate(). |
static <T> T |
ClientRequestContext.mapCurrent(Function<? super ClientRequestContext,T> mapper,
Supplier<T> defaultValueSupplier)
Maps the client-side context of the
Request that is being handled in the current thread. |
static SafeCloseable |
Clients.withContextCustomizer(Consumer<ClientRequestContext> contextCustomizer)
Sets the specified
ClientRequestContext customization function in a thread-local variable so that
the customized context is used when the client invokes a request from the current thread. |
| Constructor and Description |
|---|
ClientRequestContextWrapper(ClientRequestContext delegate)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected HttpResponse |
CircuitBreakerHttpClient.doExecute(ClientRequestContext ctx,
HttpRequest req,
CircuitBreaker circuitBreaker) |
protected abstract O |
CircuitBreakerClient.doExecute(ClientRequestContext ctx,
I req,
CircuitBreaker circuitBreaker)
Invoked when the
CircuitBreaker is in closed state. |
protected RpcResponse |
CircuitBreakerRpcClient.doExecute(ClientRequestContext ctx,
RpcRequest req,
CircuitBreaker circuitBreaker) |
O |
CircuitBreakerClient.execute(ClientRequestContext ctx,
I req) |
CircuitBreaker |
KeyedCircuitBreakerMapping.get(ClientRequestContext ctx,
Request req) |
K |
KeyedCircuitBreakerMapping.KeySelector.get(ClientRequestContext ctx,
Request req)
Returns the mapping key of the given
Request. |
CircuitBreaker |
CircuitBreakerMapping.get(ClientRequestContext ctx,
Request req)
Returns the
CircuitBreaker mapped to the given parameters. |
CompletionStage<Boolean> |
CircuitBreakerStrategyWithContent.shouldReportAsSuccess(ClientRequestContext ctx,
T response)
|
CompletionStage<Boolean> |
CircuitBreakerStrategy.shouldReportAsSuccess(ClientRequestContext ctx,
Throwable cause)
Returns a
CompletionStage that contains true, false or
null which indicates a Response is successful or not. |
| Modifier and Type | Method and Description |
|---|---|
HttpResponse |
HttpDecodingClient.execute(ClientRequestContext ctx,
HttpRequest req) |
| Modifier and Type | Method and Description |
|---|---|
Endpoint |
EndpointSelector.select(ClientRequestContext ctx)
|
static Endpoint |
EndpointGroupRegistry.selectNode(ClientRequestContext ctx,
String groupName)
Selects an
Endpoint from the EndpointGroup associated with the specified
ClientRequestContext and case-insensitive groupName. |
| Constructor and Description |
|---|
StickyEndpointSelectionStrategy(ToLongFunction<ClientRequestContext> requestContextHasher)
Creates a new
StickyEndpointSelectionStrategy
with provided hash function to hash a ClientRequestContext to a long. |
| Modifier and Type | Method and Description |
|---|---|
protected ConcurrencyLimitingClient.Deferred<HttpResponse> |
ConcurrencyLimitingHttpClient.defer(ClientRequestContext ctx,
HttpRequest req) |
protected abstract ConcurrencyLimitingClient.Deferred<O> |
ConcurrencyLimitingClient.defer(ClientRequestContext ctx,
I req)
Defers the specified
Request. |
O |
ConcurrencyLimitingClient.execute(ClientRequestContext ctx,
I req) |
| Modifier and Type | Method and Description |
|---|---|
protected static ClientRequestContext |
RetryingClient.newDerivedContext(ClientRequestContext ctx,
HttpRequest req,
RpcRequest rpcReq,
boolean initialAttempt)
Creates a new derived
ClientRequestContext, replacing the requests. |
| Modifier and Type | Method and Description |
|---|---|
protected HttpResponse |
RetryingHttpClient.doExecute(ClientRequestContext ctx,
HttpRequest req) |
protected abstract O |
RetryingClient.doExecute(ClientRequestContext ctx,
I req)
Invoked by
RetryingClient.execute(ClientRequestContext, Request)
after the deadline for response timeout is set. |
protected RpcResponse |
RetryingRpcClient.doExecute(ClientRequestContext ctx,
RpcRequest req) |
O |
RetryingClient.execute(ClientRequestContext ctx,
I req) |
protected long |
RetryingClient.getNextDelay(ClientRequestContext ctx,
Backoff backoff)
Returns the next delay which retry will be made after.
|
protected long |
RetryingClient.getNextDelay(ClientRequestContext ctx,
Backoff backoff,
long millisAfterFromServer)
Returns the next delay which retry will be made after.
|
protected static int |
RetryingClient.getTotalAttempts(ClientRequestContext ctx)
Returns the total number of attempts of the current request represented by the specified
ClientRequestContext. |
protected static ClientRequestContext |
RetryingClient.newDerivedContext(ClientRequestContext ctx,
HttpRequest req,
RpcRequest rpcReq,
boolean initialAttempt)
Creates a new derived
ClientRequestContext, replacing the requests. |
protected static void |
RetryingClient.onRetryingComplete(ClientRequestContext ctx)
This should be called when retrying is finished.
|
protected static void |
RetryingClient.scheduleNextRetry(ClientRequestContext ctx,
Consumer<? super Throwable> actionOnException,
Runnable retryTask,
long nextDelayMillis)
Schedules next retry.
|
protected boolean |
RetryingClient.setResponseTimeout(ClientRequestContext ctx)
Resets the
responseTimeoutMillis(). |
CompletionStage<Backoff> |
RetryStrategyWithContent.shouldRetry(ClientRequestContext ctx,
T response)
Tells whether the request sent with the specified
ClientRequestContext requires a retry or not. |
CompletionStage<Backoff> |
RetryStrategy.shouldRetry(ClientRequestContext ctx,
Throwable cause)
Tells whether the request sent with the specified
ClientRequestContext requires a retry or not. |
| Modifier and Type | Method and Description |
|---|---|
static <I extends Request,O extends Response,U extends Client<I,O>> |
ClientUtil.executeWithFallback(U delegate,
ClientRequestContext ctx,
BiFunction<ClientRequestContext,Throwable,O> fallback) |
| Modifier and Type | Method and Description |
|---|---|
static <I extends Request,O extends Response,U extends Client<I,O>> |
ClientUtil.executeWithFallback(U delegate,
ClientRequestContext ctx,
BiFunction<ClientRequestContext,Throwable,O> fallback) |
static <I extends Request,O extends Response,U extends Client<I,O>> |
ClientUtil.initContextAndExecuteWithFallback(U delegate,
DefaultClientRequestContext ctx,
Endpoint endpoint,
BiFunction<ClientRequestContext,Throwable,O> fallback) |
Copyright © 2020 LeanCloud. All rights reserved.