1
0
mirror of https://gitee.com/mirrors/Spring-Cloud-Alibaba.git synced 2021-06-26 13:25:11 +08:00

fix bug about feign and update examples

This commit is contained in:
fangjian0423 2019-03-26 20:18:07 +08:00
parent ec98a2db01
commit 080ad2df1e
3 changed files with 15 additions and 2 deletions

View File

@ -0,0 +1,7 @@
#!/usr/bin/env bash
n=1
while [ $n -le 10 ]
do
echo `curl -s http://localhost:18083/divide-feign?a=1\&b=0`
let n++
done

View File

@ -16,5 +16,11 @@
"count": 20.0,
"grade": 0,
"timeWindow": 30
},
{
"resource": "GET:http://service-provider/divide",
"count": 0.5,
"grade": 1,
"timeWindow": 30
}
]

View File

@ -95,7 +95,7 @@ public class SentinelInvocationHandler implements InvocationHandler {
+ Feign.configKey(method.getDeclaringClass(), method));
// resource default is HttpMethod:protocol://url
String resourceName = methodMetadata.template().method().toUpperCase() + ":"
+ hardCodedTarget.url() + methodMetadata.template().url();
+ hardCodedTarget.url() + methodMetadata.template().path();
Entry entry = null;
try {
ContextUtil.enter(resourceName);
@ -128,7 +128,7 @@ public class SentinelInvocationHandler implements InvocationHandler {
}
finally {
if (entry != null) {
entry.exit();
entry.exit(1, args);
}
ContextUtil.exit();
}