@Experimental public abstract class AsyncFeign<C> extends Feign
Feign to provide support for asynchronous clients. Context (for example for
session cookies or tokens) is explicit, as calls for the same session may be done across several
threads. Retryer is not supported in this model, as that is a blocking API.
ExceptionPropagationPolicy is made redundant as RetryableException is never
thrown. clients. CompletableFuture with a non-wildcard type. As the
completion is done by the AsyncClient, it is important that any subsequent processing on
the thread be short - generally, this should involve notifying some other thread of the work to
be done (for example, creating and submitting a task to an ExecutorService).| Modifier and Type | Class and Description |
|---|---|
static class |
AsyncFeign.AsyncBuilder<C> |
Feign.Builder, Feign.ResponseMappingDecoder| Modifier | Constructor and Description |
|---|---|
protected |
AsyncFeign(AsyncFeign.AsyncBuilder<C> asyncBuilder) |
| Modifier and Type | Method and Description |
|---|---|
static <C> AsyncFeign.AsyncBuilder<C> |
asyncBuilder() |
protected void |
clearInvocationContext() |
<T> T |
newInstance(Target<T> target)
Returns a new instance of an HTTP API, defined by annotations in the
Contract,
for the specified target. |
<T> T |
newInstance(Target<T> target,
C context) |
protected void |
setInvocationContext(feign.AsyncInvocation<C> invocationContext) |
protected abstract <T> T |
wrap(Class<T> type,
T instance,
C context) |
protected AsyncFeign(AsyncFeign.AsyncBuilder<C> asyncBuilder)
public static <C> AsyncFeign.AsyncBuilder<C> asyncBuilder()
protected void setInvocationContext(feign.AsyncInvocation<C> invocationContext)
protected void clearInvocationContext()
public <T> T newInstance(Target<T> target)
FeignContract,
for the specified target. You should cache this result.newInstance in class FeignCopyright © 2012–2020 OpenFeign. All rights reserved.