mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
update sentinel examples
This commit is contained in:
parent
9f8e6b2f5f
commit
145c14058b
@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
n=1
|
||||
while [ $n -le 10 ]
|
||||
do
|
||||
echo `curl -s http://localhost:18083/divide-feign2?a=1`
|
||||
let n++
|
||||
done
|
@ -49,6 +49,10 @@ public class ConsumerApplication {
|
||||
@RequestMapping(value = "/divide", method = RequestMethod.GET)
|
||||
String divide(@RequestParam("a") Integer a, @RequestParam("b") Integer b);
|
||||
|
||||
default String divide(Integer a) {
|
||||
return divide(a, 1);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/notFound", method = RequestMethod.GET)
|
||||
String notFound();
|
||||
}
|
||||
|
@ -75,6 +75,11 @@ public class TestController {
|
||||
return echoService.divide(a, b);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/divide-feign2", method = RequestMethod.GET)
|
||||
public String divide(@RequestParam Integer a) {
|
||||
return echoService.divide(a);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/echo-feign/{str}", method = RequestMethod.GET)
|
||||
public String feign(@PathVariable String str) {
|
||||
return echoService.echo(str);
|
||||
|
@ -6,5 +6,13 @@
|
||||
"grade": 1,
|
||||
"limitApp": "default",
|
||||
"strategy": 0
|
||||
},
|
||||
{
|
||||
"resource": "GET:http://service-provider/divide",
|
||||
"controlBehavior": 0,
|
||||
"count": 0,
|
||||
"grade": 1,
|
||||
"limitApp": "default",
|
||||
"strategy": 0
|
||||
}
|
||||
]
|
Loading…
x
Reference in New Issue
Block a user