public class TraceAsyncClientHttpRequestFactoryWrapper extends Object implements org.springframework.http.client.ClientHttpRequestFactory, org.springframework.http.client.AsyncClientHttpRequestFactory
AsyncClientHttpRequest
and to the ClientHttpRequest| Modifier and Type | Field and Description |
|---|---|
protected HttpTraceKeysInjector |
keysInjector |
protected static org.apache.commons.logging.Log |
log |
protected HttpSpanInjector |
spanInjector |
protected Tracer |
tracer |
| Constructor and Description |
|---|
TraceAsyncClientHttpRequestFactoryWrapper(Tracer tracer,
HttpSpanInjector spanInjector,
org.springframework.http.client.AsyncClientHttpRequestFactory asyncDelegate,
org.springframework.http.client.ClientHttpRequestFactory syncDelegate,
HttpTraceKeysInjector httpTraceKeysInjector) |
TraceAsyncClientHttpRequestFactoryWrapper(Tracer tracer,
HttpSpanInjector spanInjector,
org.springframework.http.client.AsyncClientHttpRequestFactory asyncDelegate,
HttpTraceKeysInjector httpTraceKeysInjector)
According to the JavaDocs all Spring
AsyncClientHttpRequestFactory implement
the ClientHttpRequestFactory interface. |
TraceAsyncClientHttpRequestFactoryWrapper(Tracer tracer,
HttpSpanInjector spanInjector,
HttpTraceKeysInjector httpTraceKeysInjector)
Default implementation that creates a
SimpleClientHttpRequestFactory that
has a wrapped task executor via the TraceAsyncListenableTaskExecutor |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addRequestTags(org.springframework.http.HttpRequest request)
Adds HTTP tags to the client side span
|
org.springframework.http.client.AsyncClientHttpRequest |
createAsyncRequest(URI uri,
org.springframework.http.HttpMethod httpMethod) |
org.springframework.http.client.ClientHttpRequest |
createRequest(URI uri,
org.springframework.http.HttpMethod httpMethod) |
protected Span |
currentSpan() |
void |
finish()
Close the current span and log the client received event
|
protected boolean |
isTracing() |
protected void |
publishStartEvent(org.springframework.http.HttpRequest request)
Enriches the request with proper headers and publishes
the client sent event
|
protected static final org.apache.commons.logging.Log log
protected final Tracer tracer
protected final HttpSpanInjector spanInjector
protected final HttpTraceKeysInjector keysInjector
public TraceAsyncClientHttpRequestFactoryWrapper(Tracer tracer, HttpSpanInjector spanInjector, org.springframework.http.client.AsyncClientHttpRequestFactory asyncDelegate, HttpTraceKeysInjector httpTraceKeysInjector)
AsyncClientHttpRequestFactory implement
the ClientHttpRequestFactory interface.
In case that it's not true we're setting the SimpleClientHttpRequestFactory
as a default for sync request processing.AsyncRestTemplate.AsyncRestTemplate(AsyncClientHttpRequestFactory)public TraceAsyncClientHttpRequestFactoryWrapper(Tracer tracer, HttpSpanInjector spanInjector, HttpTraceKeysInjector httpTraceKeysInjector)
SimpleClientHttpRequestFactory that
has a wrapped task executor via the TraceAsyncListenableTaskExecutorpublic TraceAsyncClientHttpRequestFactoryWrapper(Tracer tracer, HttpSpanInjector spanInjector, org.springframework.http.client.AsyncClientHttpRequestFactory asyncDelegate, org.springframework.http.client.ClientHttpRequestFactory syncDelegate, HttpTraceKeysInjector httpTraceKeysInjector)
public org.springframework.http.client.AsyncClientHttpRequest createAsyncRequest(URI uri, org.springframework.http.HttpMethod httpMethod) throws IOException
createAsyncRequest in interface org.springframework.http.client.AsyncClientHttpRequestFactoryIOExceptionpublic org.springframework.http.client.ClientHttpRequest createRequest(URI uri, org.springframework.http.HttpMethod httpMethod) throws IOException
createRequest in interface org.springframework.http.client.ClientHttpRequestFactoryIOExceptionprotected void publishStartEvent(org.springframework.http.HttpRequest request)
protected void addRequestTags(org.springframework.http.HttpRequest request)
public void finish()
protected Span currentSpan()
protected boolean isTracing()
Copyright © 2017 Pivotal Software, Inc.. All rights reserved.