public class JettyClientHttpConnector extends java.lang.Object implements ClientHttpConnector
ClientHttpConnector.
Implemented with buffer copy instead of optimized buffer wrapping because the latter
hangs since Callback.succeeded() doesn't allow releasing the buffer and
requesting more data at different times (required for Mono<DataBuffer> for example).
See https://github.com/eclipse/jetty.project/issues/2429 for more details.| Constructor and Description |
|---|
JettyClientHttpConnector()
Default constructor that creates a new instance of
HttpClient. |
JettyClientHttpConnector(org.eclipse.jetty.client.HttpClient httpClient)
Constructor with an initialized
HttpClient. |
JettyClientHttpConnector(JettyResourceFactory resourceFactory,
java.util.function.Consumer<org.eclipse.jetty.client.HttpClient> customizer)
Constructor with an
JettyResourceFactory that will manage shared resources. |
| Modifier and Type | Method and Description |
|---|---|
reactor.core.publisher.Mono<ClientHttpResponse> |
connect(HttpMethod method,
java.net.URI uri,
java.util.function.Function<? super ClientHttpRequest,reactor.core.publisher.Mono<java.lang.Void>> requestCallback)
Connect to the origin server using the given
HttpMethod and
URI and apply the given requestCallback when the HTTP
request of the underlying API can be initialized and written to. |
void |
setBufferFactory(DataBufferFactory bufferFactory) |
public JettyClientHttpConnector()
HttpClient.public JettyClientHttpConnector(JettyResourceFactory resourceFactory, @Nullable java.util.function.Consumer<org.eclipse.jetty.client.HttpClient> customizer)
JettyResourceFactory that will manage shared resources.resourceFactory - the JettyResourceFactory to usecustomizer - the lambda used to customize the HttpClientpublic JettyClientHttpConnector(org.eclipse.jetty.client.HttpClient httpClient)
HttpClient.public void setBufferFactory(DataBufferFactory bufferFactory)
public reactor.core.publisher.Mono<ClientHttpResponse> connect(HttpMethod method, java.net.URI uri, java.util.function.Function<? super ClientHttpRequest,reactor.core.publisher.Mono<java.lang.Void>> requestCallback)
ClientHttpConnectorHttpMethod and
URI and apply the given requestCallback when the HTTP
request of the underlying API can be initialized and written to.connect in interface ClientHttpConnectormethod - the HTTP request methoduri - the HTTP request URIrequestCallback - a function that prepares and writes to the request,
returning a publisher that signals when it's done writing.
Implementations can return a Mono<Void> by calling
ReactiveHttpOutputMessage.writeWith(org.reactivestreams.Publisher<? extends org.springframework.core.io.buffer.DataBuffer>) or ReactiveHttpOutputMessage.setComplete().ClientHttpResponse