Class RequestIdInterceptor
java.lang.Object
com.helixframework.resttemplate.requestid.RequestIdInterceptor
- All Implemented Interfaces:
org.springframework.http.client.ClientHttpRequestInterceptor
public class RequestIdInterceptor
extends Object
implements org.springframework.http.client.ClientHttpRequestInterceptor
RestTemplate interceptor that sets the upstream request id, found in the Helix context, onto downstream calls
automatically.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.client.ClientHttpResponseintercept(org.springframework.http.HttpRequest request, byte[] body, org.springframework.http.client.ClientHttpRequestExecution execution)
-
Field Details
-
REQUEST_ID_CTX_NAME
Name of the variable in the request context and MDC that holds the current request id.- See Also:
-
REQUEST_ID_HEADER_NAME
Name of the request id header.- See Also:
-
-
Constructor Details
-
RequestIdInterceptor
public RequestIdInterceptor()
-
-
Method Details
-
intercept
public org.springframework.http.client.ClientHttpResponse intercept(org.springframework.http.HttpRequest request, byte[] body, org.springframework.http.client.ClientHttpRequestExecution execution) throws IOException - Specified by:
interceptin interfaceorg.springframework.http.client.ClientHttpRequestInterceptor- Throws:
IOException
-