use of brave.spring.web.TracingClientHttpRequestInterceptor in project spring-cloud-sleuth by spring-cloud.
the class TraceUserInfoRestTemplateCustomizer method customize.
@Override
public void customize(OAuth2RestTemplate template) {
final TracingClientHttpRequestInterceptor interceptor = this.beanFactory.getBean(TracingClientHttpRequestInterceptor.class);
new RestTemplateInterceptorInjector(interceptor).inject(template);
if (this.delegate != null) {
((UserInfoRestTemplateCustomizer) this.delegate).customize(template);
}
}
use of brave.spring.web.TracingClientHttpRequestInterceptor in project spring-cloud-sleuth by spring-cloud.
the class MySecondClientHttpRequestInterceptor method assertInterceptorsOrder.
private void assertInterceptorsOrder(List<ClientHttpRequestInterceptor> interceptors) {
int traceInterceptorIndex = -1;
int myInterceptorIndex = -1;
int mySecondInterceptorIndex = -1;
for (int i = 0; i < interceptors.size(); i++) {
ClientHttpRequestInterceptor interceptor = interceptors.get(i);
if (interceptor instanceof TracingClientHttpRequestInterceptor || interceptor instanceof LazyTracingClientHttpRequestInterceptor) {
traceInterceptorIndex = i;
} else if (interceptor instanceof MyClientHttpRequestInterceptor) {
myInterceptorIndex = i;
} else if (interceptor instanceof MySecondClientHttpRequestInterceptor) {
mySecondInterceptorIndex = i;
}
}
then(traceInterceptorIndex).isGreaterThanOrEqualTo(0).isLessThan(myInterceptorIndex).isLessThan(mySecondInterceptorIndex);
}
Aggregations