pull/783/head
fangjian0423 6 years ago
parent 36a4cc9c08
commit 9f8e6b2f5f

@ -94,8 +94,12 @@ public class SentinelInvocationHandler implements InvocationHandler {
.get(hardCodedTarget.type().getName()
+ Feign.configKey(hardCodedTarget.type(), method));
// resource default is HttpMethod:protocol://url
String resourceName = methodMetadata.template().method().toUpperCase() + ":"
+ hardCodedTarget.url() + methodMetadata.template().path();
if (methodMetadata == null) {
result = methodHandler.invoke(args);
}
else {
String resourceName = methodMetadata.template().method().toUpperCase()
+ ":" + hardCodedTarget.url() + methodMetadata.template().path();
Entry entry = null;
try {
ContextUtil.enter(resourceName);
@ -114,7 +118,8 @@ public class SentinelInvocationHandler implements InvocationHandler {
return fallbackResult;
}
catch (IllegalAccessException e) {
// shouldn't happen as method is public due to being an interface
// shouldn't happen as method is public due to being an
// interface
throw new AssertionError(e);
}
catch (InvocationTargetException e) {
@ -133,6 +138,7 @@ public class SentinelInvocationHandler implements InvocationHandler {
ContextUtil.exit();
}
}
}
else {
// other target type using default strategy
result = methodHandler.invoke(args);

Loading…
Cancel
Save