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 | Field and Description |
---|---|
private ClientHttpConnector |
delegate |
private java.util.Map<java.lang.String,ExchangeResult> |
exchanges |
static java.lang.String |
REQUEST_ID_HEADER_NAME |
Constructor and Description |
---|
WiretapConnector(ClientHttpConnector delegate) |
Modifier and Type | Method and Description |
---|---|
ExchangeResult |
claimRequest(java.lang.String requestId)
Retrieve the
ExchangeResult 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. |
public static final java.lang.String REQUEST_ID_HEADER_NAME
private final ClientHttpConnector delegate
private final java.util.Map<java.lang.String,ExchangeResult> exchanges
public 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 ExchangeResult claimRequest(java.lang.String requestId)
ExchangeResult
for the given "request-id" header value.