use of org.springframework.http.client.AbstractClientHttpRequest in project incubator-skywalking by apache.
the class RestRequestInterceptor method afterMethod.
@Override
public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, Object ret) throws Throwable {
ClientHttpRequest clientHttpRequest = (ClientHttpRequest) ret;
if (clientHttpRequest instanceof AbstractClientHttpRequest) {
AbstractClientHttpRequest httpRequest = (AbstractClientHttpRequest) clientHttpRequest;
ContextCarrier contextCarrier = (ContextCarrier) objInst.getSkyWalkingDynamicField();
CarrierItem next = contextCarrier.items();
while (next.hasNext()) {
next = next.next();
httpRequest.getHeaders().set(next.getHeadKey(), next.getHeadValue());
}
}
return ret;
}
Aggregations