提交 b79851a6 编写于 作者: M ManongJu

add simple

上级 0f0ab01f
java -jar .\target\Micro-Service-Skeleton-Auth-0.0.1-SNAPSHOT.jar
\ No newline at end of file
java -jar .\target\Micro-Service-Skeleton-Gateway-0.0.1-SNAPSHOT.jar
\ No newline at end of file
java -jar .\target\Micro-Service-Skeleton-Order-Service-0.0.1-SNAPSHOT.jar --spring.profiles.active=node1
\ No newline at end of file
java -jar .\target\Micro-Service-Skeleton-Order-Service-0.0.1-SNAPSHOT.jar --spring.profiles.active=node2
\ No newline at end of file
......@@ -19,9 +19,9 @@ public class SimpleController {
@RequestMapping(value = "getWord")
@HystrixCommand(fallbackMethod = "helloFallback",commandKey = "getWord",groupKey = "SimpleController",threadPoolKey = "SimplePool")
@CacheResult(cacheKeyMethod = "getKey")
// @CacheResult(cacheKeyMethod = "getKey")
public String getWord(){
return restTemplate.getForEntity("http://order-service/order",String.class).getBody();
return restTemplate.getForEntity("http://order-service/hello",String.class).getBody();
}
private String helloFallback(){
return "error";
......
......@@ -36,4 +36,13 @@ ribbon:
# 重试其他实例的最大重试次数,不包括首次所选的server
MaxAutoRetriesNextServer: 2
# 是否所有操作都进行重试
OkToRetryOnAllOperations: true
\ No newline at end of file
OkToRetryOnAllOperations: true
hystrix:
command:
default:
execution:
timeout:
enabled: true
isolation:
thread:
timeoutInMilliseconds: 600000
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册