TracEE binding for Spring HTTP client

This module contains all necessary classes to transmit the MDC within your Spring RestTemplate-Request and extract the MDC from server response.

Requires Spring-Web in version 3.1 or above.

  • TraceeClientHttpRequestInterceptor: An interceptor attachable to the Spring-Web RestTemplate.


If you use RestTemplate for your REST remote calls it’s pretty clear that you’ve already added a dependency to spring-web. To use TracEE you need the tracee-springhttpclient dependency as well.

For maven you’ve to add following dependency to your pom.xml:

    <version>RELEASE</version> <!-- You should specify a version instead -->

After that you’ve to add the TraceeClientHttpRequestInterceptor to your RestTemplate:

final RestTemplate restTemplate = new RestTemplate();
    new TraceeClientHttpRequestInterceptor()));
restTemplate.getForObject(serverEndpoint, ...);

This can also be achieved using spring xml configuration. The following context.xml demonstrates how to integrate the binding via spring xml configuration.

<beans xmlns=""

	<bean id="traceeHttpClientInterceptor"

	<bean id="myRestTemplate" class="org.springframework.web.client.RestTemplate">
		<property name="interceptors">
			<list merge="true">
				<ref bean="traceeHttpClientInterceptor"/>



This project is released under the revised BSD License.

Social Links


Web-Template based on SOLID by Carlos Alvarez and remixed according to the Creative Commons Attribution 3.0 License.