@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(Feign feign,
AsyncContextSupplier<C> defaultContextSupplier) |
| Modifier and Type | Method and Description |
|---|---|
static <C> AsyncFeign.AsyncBuilder<C> |
asyncBuilder() |
<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 abstract <T> T |
wrap(Class<T> type,
T instance,
C context) |
protected AsyncFeign(Feign feign, AsyncContextSupplier<C> defaultContextSupplier)
public static <C> AsyncFeign.AsyncBuilder<C> asyncBuilder()
public <T> T newInstance(Target<T> target)
FeignContract,
for the specified target. You should cache this result.newInstance in class FeignCopyright © 2012–2022 OpenFeign. All rights reserved.