This document contains documentation for the
tracee-httpcomponents5
module. Check the TracEE main documentation to get started.
Wrapper for apache http client 5+
This module contains two interceptors:
- TraceeHttpRequestInterceptor: Implements the
HttpRequestInterceptor
interface to add the tracee header to the request. - TraceeHttpResponseInterceptor: Implements the
HttpResponseInterceptor
to extract the tracee header from the response.
<dependencies>
...
<dependency>
<groupId>io.tracee.binding</groupId>
<artifactId>tracee-httpcomponents5</artifactId>
<version>${tracee.version}</version>
</dependency>
...
</dependencies>
Then add simply two interceptors to your HttpClient of the httpcomponents module:
HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
httpClientBuilder.addInterceptorLast(new TraceeHttpRequestInterceptor());
httpClientBuilder.addInterceptorFirst(new TraceeHttpResponseInterceptor());
CloseableHttpClient httpClient = httpClientBuilder.build();