class WiretapConnector extends java.lang.Object implements ClientHttpConnector
ClientHttpConnector
with the purpose of
intercepting, capturing, and exposing actual request and response data
transmitted to and received from the server.HttpHandlerConnector
Modifier and Type | Class and Description |
---|---|
(package private) class |
WiretapConnector.Info |
private static class |
WiretapConnector.WiretapClientHttpRequest
ClientHttpRequestDecorator that intercepts and saves the request body.
|
private static class |
WiretapConnector.WiretapClientHttpResponse
ClientHttpResponseDecorator that intercepts and saves the response body.
|
Modifier and Type | Field and Description |
---|---|
private static DataBufferFactory |
bufferFactory |
private ClientHttpConnector |
delegate |
private java.util.Map<java.lang.String,WiretapConnector.Info> |
exchanges |
Constructor and Description |
---|
WiretapConnector(ClientHttpConnector delegate) |
Modifier and Type | Method and Description |
---|---|
WiretapConnector.Info |
claimRequest(java.lang.String requestId)
Retrieve the
WiretapConnector.Info for the given "request-id" header value. |
<any> |
connect(HttpMethod method,
java.net.URI uri,
java.util.function.Function<? super ClientHttpRequest,<any>> requestCallback)
Connect to the origin server using the given
HttpMethod and
URI , then apply the given requestCallback on the
ClientHttpRequest once the connection has been established. |
private static final DataBufferFactory bufferFactory
private final ClientHttpConnector delegate
private final java.util.Map<java.lang.String,WiretapConnector.Info> exchanges
WiretapConnector(ClientHttpConnector delegate)
public <any> connect(HttpMethod method, java.net.URI uri, java.util.function.Function<? super ClientHttpRequest,<any>> requestCallback)
ClientHttpConnector
HttpMethod
and
URI
, then apply the given requestCallback
on the
ClientHttpRequest
once the connection has been established.
Return a publisher of the ClientHttpResponse
.
connect
in interface ClientHttpConnector
method
- the HTTP request methoduri
- the HTTP request URIrequestCallback
- a function that prepares and writes the request,
returning a publisher that signals when it's done interacting with the
request. Implementations should return a Mono<Void>
by calling
ReactiveHttpOutputMessage.writeWith(<any>)
or ReactiveHttpOutputMessage.setComplete()
.ClientHttpResponse
public WiretapConnector.Info claimRequest(java.lang.String requestId)
WiretapConnector.Info
for the given "request-id" header value.