mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
fix #782
This commit is contained in:
parent
36a4cc9c08
commit
9f8e6b2f5f
@ -94,8 +94,12 @@ public class SentinelInvocationHandler implements InvocationHandler {
|
|||||||
.get(hardCodedTarget.type().getName()
|
.get(hardCodedTarget.type().getName()
|
||||||
+ Feign.configKey(hardCodedTarget.type(), method));
|
+ Feign.configKey(hardCodedTarget.type(), method));
|
||||||
// resource default is HttpMethod:protocol://url
|
// resource default is HttpMethod:protocol://url
|
||||||
String resourceName = methodMetadata.template().method().toUpperCase() + ":"
|
if (methodMetadata == null) {
|
||||||
+ hardCodedTarget.url() + methodMetadata.template().path();
|
result = methodHandler.invoke(args);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
String resourceName = methodMetadata.template().method().toUpperCase()
|
||||||
|
+ ":" + hardCodedTarget.url() + methodMetadata.template().path();
|
||||||
Entry entry = null;
|
Entry entry = null;
|
||||||
try {
|
try {
|
||||||
ContextUtil.enter(resourceName);
|
ContextUtil.enter(resourceName);
|
||||||
@ -114,7 +118,8 @@ public class SentinelInvocationHandler implements InvocationHandler {
|
|||||||
return fallbackResult;
|
return fallbackResult;
|
||||||
}
|
}
|
||||||
catch (IllegalAccessException e) {
|
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);
|
throw new AssertionError(e);
|
||||||
}
|
}
|
||||||
catch (InvocationTargetException e) {
|
catch (InvocationTargetException e) {
|
||||||
@ -133,6 +138,7 @@ public class SentinelInvocationHandler implements InvocationHandler {
|
|||||||
ContextUtil.exit();
|
ContextUtil.exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
// other target type using default strategy
|
// other target type using default strategy
|
||||||
result = methodHandler.invoke(args);
|
result = methodHandler.invoke(args);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user