| 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.logging |
Logging client decorators.
|
| com.linecorp.armeria.client.retry |
A
Client decorator that handles failures and retries requests. |
| com.linecorp.armeria.internal.client |
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. |
ClientRequestContext |
ClientRequestContextCaptor.get()
Returns the
ClientRequestContext captured first. |
ClientRequestContext |
ClientRequestContextCaptor.getOrNull()
Returns the
ClientRequestContext captured first, or null if unavailable. |
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 |
|---|---|
List<ClientRequestContext> |
ClientRequestContextCaptor.getAll()
Returns all
ClientRequestContexts captured so far. |
| 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.select(ClientRequestContext ctx) |
| Modifier and Type | Method and Description |
|---|---|
protected O |
UserClient.execute(EndpointGroup endpointGroup,
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<? super 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 |
CircuitBreakerClient.doExecute(ClientRequestContext ctx,
HttpRequest req,
CircuitBreaker circuitBreaker) |
protected abstract O |
AbstractCircuitBreakerClient.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 |
AbstractCircuitBreakerClient.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 |
DecodingClient.execute(ClientRequestContext ctx,
HttpRequest req) |
| Modifier and Type | Method and Description |
|---|---|
Endpoint |
EndpointSelector.select(ClientRequestContext ctx)
|
Endpoint |
EndpointGroup.select(ClientRequestContext ctx)
Selects an
Endpoint from this EndpointGroup. |
Endpoint |
DynamicEndpointGroup.select(ClientRequestContext ctx) |
| 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 |
|---|---|
O |
AbstractConcurrencyLimitingClient.execute(ClientRequestContext ctx,
I req) |
protected HttpResponse |
ConcurrencyLimitingClient.newDeferredResponse(ClientRequestContext ctx,
CompletionStage<HttpResponse> resFuture) |
protected abstract O |
AbstractConcurrencyLimitingClient.newDeferredResponse(ClientRequestContext ctx,
CompletionStage<O> resFuture)
Implement this method to return a new
Response which delegates to the Response
the specified CompletionStage is completed with. |
| Modifier and Type | Method and Description |
|---|---|
HttpResponse |
ContentPreviewingClient.execute(ClientRequestContext ctx,
HttpRequest req) |
| Modifier and Type | Method and Description |
|---|---|
LoggingRpcClientBuilder |
LoggingRpcClientBuilder.sampler(Sampler<? super ClientRequestContext> sampler) |
LoggingClientBuilder |
LoggingClientBuilder.sampler(Sampler<? super ClientRequestContext> sampler) |
| Modifier and Type | Method and Description |
|---|---|
protected static ClientRequestContext |
AbstractRetryingClient.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 |
RetryingClient.doExecute(ClientRequestContext ctx,
HttpRequest req) |
protected abstract O |
AbstractRetryingClient.doExecute(ClientRequestContext ctx,
I req)
Invoked by
AbstractRetryingClient.execute(ClientRequestContext, Request)
after the deadline for response timeout is set. |
protected RpcResponse |
RetryingRpcClient.doExecute(ClientRequestContext ctx,
RpcRequest req) |
O |
AbstractRetryingClient.execute(ClientRequestContext ctx,
I req) |
protected long |
AbstractRetryingClient.getNextDelay(ClientRequestContext ctx,
Backoff backoff)
Returns the next delay which retry will be made after.
|
protected long |
AbstractRetryingClient.getNextDelay(ClientRequestContext ctx,
Backoff backoff,
long millisAfterFromServer)
Returns the next delay which retry will be made after.
|
protected static int |
AbstractRetryingClient.getTotalAttempts(ClientRequestContext ctx)
Returns the total number of attempts of the current request represented by the specified
ClientRequestContext. |
protected static ClientRequestContext |
AbstractRetryingClient.newDerivedContext(ClientRequestContext ctx,
HttpRequest req,
RpcRequest rpcReq,
boolean initialAttempt)
Creates a new derived
ClientRequestContext, replacing the requests. |
protected static void |
AbstractRetryingClient.onRetryingComplete(ClientRequestContext ctx)
This should be called when retrying is finished.
|
protected static void |
AbstractRetryingClient.scheduleNextRetry(ClientRequestContext ctx,
Consumer<? super Throwable> actionOnException,
Runnable retryTask,
long nextDelayMillis)
Schedules next retry.
|
protected boolean |
AbstractRetryingClient.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,
EndpointGroup endpointGroup,
BiFunction<ClientRequestContext,Throwable,O> fallback) |
Copyright © 2020 LeanCloud. All rights reserved.