提交 750e57fc 编写于 作者: A ascrutae

fix issue restemplate plugin don’t works fine

上级 8658ca77
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
* Project repository: https://github.com/OpenSkywalking/skywalking * Project repository: https://github.com/OpenSkywalking/skywalking
*/ */
package org.springframework.http.client; package org.skywalking.apm.plugin.spring.resttemplate.async;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import org.skywalking.apm.agent.core.context.CarrierItem; import org.skywalking.apm.agent.core.context.CarrierItem;
...@@ -24,6 +24,7 @@ import org.skywalking.apm.agent.core.context.ContextCarrier; ...@@ -24,6 +24,7 @@ import org.skywalking.apm.agent.core.context.ContextCarrier;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance; import org.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor; import org.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult; import org.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
import org.springframework.http.client.AsyncClientHttpRequest;
public class RestRequestInterceptor implements InstanceMethodsAroundInterceptor { public class RestRequestInterceptor implements InstanceMethodsAroundInterceptor {
...@@ -36,7 +37,7 @@ public class RestRequestInterceptor implements InstanceMethodsAroundInterceptor ...@@ -36,7 +37,7 @@ public class RestRequestInterceptor implements InstanceMethodsAroundInterceptor
@Override @Override
public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
Object ret) throws Throwable { Object ret) throws Throwable {
AbstractAsyncClientHttpRequest clientHttpRequest = (AbstractAsyncClientHttpRequest)ret; AsyncClientHttpRequest clientHttpRequest = (AsyncClientHttpRequest)ret;
if (ret != null) { if (ret != null) {
Object[] cacheValues = (Object[])objInst.getSkyWalkingDynamicField(); Object[] cacheValues = (Object[])objInst.getSkyWalkingDynamicField();
ContextCarrier contextCarrier = (ContextCarrier)cacheValues[1]; ContextCarrier contextCarrier = (ContextCarrier)cacheValues[1];
......
...@@ -47,7 +47,7 @@ public class RestTemplateInstrumentation extends ClassInstanceMethodsEnhancePlug ...@@ -47,7 +47,7 @@ public class RestTemplateInstrumentation extends ClassInstanceMethodsEnhancePlug
private static final String DO_EXECUTE_METHOD_NAME = "doExecute"; private static final String DO_EXECUTE_METHOD_NAME = "doExecute";
private static final String DO_EXECUTE_INTERCEPTOR = "org.skywalking.apm.plugin.spring.resttemplate.async.RestExecuteInterceptor"; private static final String DO_EXECUTE_INTERCEPTOR = "org.skywalking.apm.plugin.spring.resttemplate.async.RestExecuteInterceptor";
private static final String CREATE_REQUEST_METHOD_NAME = "createAsyncRequest"; private static final String CREATE_REQUEST_METHOD_NAME = "createAsyncRequest";
private static final String CREATE_REQUEST_INTERCEPTOR = "org.springframework.http.client.RestRequestInterceptor"; private static final String CREATE_REQUEST_INTERCEPTOR = "org.skywalking.apm.plugin.spring.resttemplate.async.RestRequestInterceptor";
@Override @Override
protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() { protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册