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:
parent
ec98a2db01
commit
080ad2df1e
@ -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
|
@ -16,5 +16,11 @@
|
|||||||
"count": 20.0,
|
"count": 20.0,
|
||||||
"grade": 0,
|
"grade": 0,
|
||||||
"timeWindow": 30
|
"timeWindow": 30
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"resource": "GET:http://service-provider/divide",
|
||||||
|
"count": 0.5,
|
||||||
|
"grade": 1,
|
||||||
|
"timeWindow": 30
|
||||||
}
|
}
|
||||||
]
|
]
|
@ -95,7 +95,7 @@ public class SentinelInvocationHandler implements InvocationHandler {
|
|||||||
+ Feign.configKey(method.getDeclaringClass(), method));
|
+ Feign.configKey(method.getDeclaringClass(), method));
|
||||||
// resource default is HttpMethod:protocol://url
|
// resource default is HttpMethod:protocol://url
|
||||||
String resourceName = methodMetadata.template().method().toUpperCase() + ":"
|
String resourceName = methodMetadata.template().method().toUpperCase() + ":"
|
||||||
+ hardCodedTarget.url() + methodMetadata.template().url();
|
+ hardCodedTarget.url() + methodMetadata.template().path();
|
||||||
Entry entry = null;
|
Entry entry = null;
|
||||||
try {
|
try {
|
||||||
ContextUtil.enter(resourceName);
|
ContextUtil.enter(resourceName);
|
||||||
@ -128,7 +128,7 @@ public class SentinelInvocationHandler implements InvocationHandler {
|
|||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
if (entry != null) {
|
if (entry != null) {
|
||||||
entry.exit();
|
entry.exit(1, args);
|
||||||
}
|
}
|
||||||
ContextUtil.exit();
|
ContextUtil.exit();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user