ClientHttpConnector.
This class implements SmartLifecycle and can be optionally declared
as a Spring-managed bean.
reactor.netty.http.client.HttpClient
| Modifier and Type | Field and Description |
|---|---|
| private static final Function | |
| private HttpClient | |
| private final Object | |
| private static final Log | |
| private final Function | |
| private final ReactorResourceFactory | |
| private volatile boolean |
| Access | Constructor and Description |
|---|---|
| public | |
| public | ReactorClientHttpConnector(ReactorResourceFactory
the resource factory to obtain the resources from resourceFactory, Function<HttpClient, HttpClient> a mapper for further initialization of the created client mapper)Constructor with externally managed Reactor Netty resources, including
|
| public | ReactorClientHttpConnector(HttpClient
the client to use httpClient)Constructor with a pre-configured |
| Modifier and Type | Method and Description |
|---|---|
| private ReactorClientHttpRequest | |
| private static Function | |
| public Mono | connect(HttpMethod
the HTTP request method method, URI the HTTP request URI uri, Function<? super ClientHttpRequest, Mono<Void>> a function that prepares and writes to the request,
returning a publisher that signals when it's done writing.
Implementations can return a requestCallback)Mono<Void> by calling
ClientHttpRequest#writeWith or ClientHttpRequest#setComplete.Implements org. HttpMethod and
URI and apply the given requestCallback when the HTTP
request of the underlying API can be initialized and written to.
|
| private static HttpClient | |
| public int | getPhase()
Overrides default org. The default implementation returns |
| public boolean | isAutoStartup()
Overrides default org. true if this Lifecycle component should get
started automatically by the container at the time that the containing
ApplicationContext gets refreshed.
|
| public boolean | isRunning()
Implements org. |
| private static HttpClient. | |
| public void | |
| public void | stop()
Implements org. |
| public final void | stop(Runnable callback)
Overrides default org. |
| defaultInitializer | back to summary |
|---|---|
| private static final Function<HttpClient, HttpClient> defaultInitializer | |
| httpClient | back to summary |
|---|---|
| private HttpClient httpClient | |
| lifecycleMonitor | back to summary |
|---|---|
| private final Object lifecycleMonitor | |
| logger | back to summary |
|---|---|
| private static final Log logger | |
| mapper | back to summary |
|---|---|
| private final Function<HttpClient, HttpClient> mapper
| |
| resourceFactory | back to summary |
|---|---|
| private final ReactorResourceFactory resourceFactory
| |
| running | back to summary |
|---|---|
| private volatile boolean running | |
| ReactorClientHttpConnector | back to summary |
|---|---|
| public ReactorClientHttpConnector() Default constructor. Initializes HttpClient.create().compress() | |
| ReactorClientHttpConnector | back to summary |
|---|---|
| public ReactorClientHttpConnector(ReactorResourceFactory resourceFactory, Function<HttpClient, HttpClient> mapper) Constructor with externally managed Reactor Netty resources, including
This constructor should be used only when you don't want the client
to participate in the Reactor Netty global resources. By default the
client participates in the Reactor Netty global resources held in
| |
| ReactorClientHttpConnector | back to summary |
|---|---|
| public ReactorClientHttpConnector(HttpClient httpClient) Constructor with a pre-configured
| |
| adaptRequest | back to summary |
|---|---|
| private ReactorClientHttpRequest adaptRequest(HttpMethod method, URI uri, HttpClientRequest request, NettyOutbound nettyOutbound) | |
| applyLoopResources | back to summary |
|---|---|
| private static Function | |
| connect | back to summary |
|---|---|
| public Mono Implements org. Doc from org. Connect to the origin server using the given
| |
| createHttpClient | back to summary |
|---|---|
| private static HttpClient createHttpClient(ReactorResourceFactory resourceFactory, Function<HttpClient, HttpClient> mapper) | |
| getPhase | back to summary |
|---|---|
| public int getPhase() Overrides default org. Doc from org. Return the phase that this lifecycle object is supposed to run in. The default implementation returns
| |
| isAutoStartup | back to summary |
|---|---|
| public boolean isAutoStartup() Overrides default org. Doc from org. Returns A value of The default implementation returns
| |
| isRunning | back to summary |
|---|---|
| public boolean isRunning() Implements org. Doc from org. Check whether this component is currently running. In the case of a container, this will return
| |
| setUri | back to summary |
|---|---|
| private static HttpClient. | |
| start | back to summary |
|---|---|
| public void start() Implements org. Doc from org. Start this component. Should not throw an exception if the component is already running. In the case of a container, this will propagate the start signal to all components that apply.
| |
| stop | back to summary |
|---|---|
| public void stop() Implements org. Doc from org. Stop this component, typically in a synchronous fashion, such that the component is
fully stopped upon return of this method. Consider implementing Note that this stop notification is not guaranteed to come before destruction:
On regular shutdown, Should not throw an exception if the component is not running (not started yet). In the case of a container, this will propagate the stop signal to all components that apply.
| |
| stop | back to summary |
|---|---|
| public final void stop(Runnable callback) Overrides default org. Doc from org. Indicates that a Lifecycle component must stop if it is currently running. The provided callback is used by the The The default implementation delegates to
| |