Resilience4j 入门完成

This commit is contained in:
YunaiV
2020-05-22 08:52:53 +08:00
parent 3929648cf8
commit 7297f47f05
6 changed files with 11 additions and 6 deletions

View File

@@ -120,7 +120,7 @@
* [《芋道 Spring Boot 服务容错 Sentinel 入门》](http://www.iocoder.cn/Spring-Boot/Sentinel/?github) 对应 [lab-46](https://github.com/YunaiV/SpringBoot-Labs/tree/master/lab-46)
* [《芋道 Spring Boot 服务容错 Hystrix 入门》](http://www.iocoder.cn/Spring-Boot/Hystrix/?github) 对应 [lab-57](https://github.com/YunaiV/SpringBoot-Labs/tree/master/lab-57)
* 《芋道 Spring Boot 服务容错 Resilience4j 入门》计划中...
* [《芋道 Spring Boot 服务容错 Resilience4j 入门》](http://www.iocoder.cn/Spring-Boot/Resilience4j/?github) 对应 [lab-59](https://github.com/YunaiV/SpringBoot-Labs/tree/master/lab-59)
## 监控管理
@@ -182,7 +182,8 @@
* [《芋道 Spring Cloud Alibaba 服务容错 Sentinel 入门》](http://www.iocoder.cn/Spring-Cloud-Alibaba/Sentinel/?github) 对应 [labx-04](https://github.com/YunaiV/SpringBoot-Labs/tree/master/labx-04)
* [《芋道 Spring Cloud Netflix 服务容错 Hystrix 入门》](http://www.iocoder.cn/Spring-Cloud/Netflix-Hystrix/?github) 对应 [labx-23](https://github.com/YunaiV/SpringBoot-Labs/tree/master/labx-23)
* 《芋道 Spring Cloud 服务容错 Resilience4j 入门》计划中...
* [《芋道 Spring Cloud 服务容错 Resilience4j 入门》](http://www.iocoder.cn/Spring-Cloud/Resilience4j/?github) 对应 [lab-59](https://github.com/YunaiV/SpringBoot-Labs/tree/master/lab-59)
* 《芋道 Spring Cloud 服务容错 Spring Cloud CircuitBreaker》计划中...
## API 网关

View File

@@ -0,0 +1 @@
<http://www.iocoder.cn/Spring-Boot/Resilience4j/?github>

View File

@@ -32,14 +32,16 @@ public class DemoController {
@Override
public String get() {
logger.info("[getUser][准备调用 user-service 获取用户({})详情]", id);
return restTemplate.getForEntity("http://127.0.0.1:18080/user/get?id=" + id, String.class).getBody();
return restTemplate.getForEntity("http://127.0.0.1:18080/user/get?id="
+ id, String.class).getBody();
}
}, new Function<Throwable, String>() {
@Override
public String apply(Throwable throwable) {
logger.info("[getUserFallback][id({}) exception({})]", id, throwable.getClass().getSimpleName());
logger.info("[getUserFallback][id({}) exception({})]", id,
throwable.getClass().getSimpleName());
return "mock:User:" + id;
}

View File

@@ -0,0 +1 @@
<http://www.iocoder.cn/Spring-Cloud/Resilience4j/?github>

View File

@@ -69,6 +69,7 @@
<!-- <module>lab-56</module>-->
<!-- <module>lab-57</module>-->
<!-- <module>lab-58</module>-->
<!-- <module>lab-59</module>-->
<!-- Spring Cloud 示例 -->
<!-- <module>labx-01</module>-->
@@ -94,9 +95,8 @@
<!-- <module>labx-21</module>-->
<!-- <module>labx-22</module>-->
<!-- <module>labx-23</module>-->
<!-- <module>labx-24</module>-->
<module>lab-59</module>
<module>labx-24</module>
</modules>
</project>