diff --git a/README.md b/README.md index d2d38287..c5969915 100644 --- a/README.md +++ b/README.md @@ -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 网关 diff --git a/lab-59/《芋道 Spring Boot 服务容错 Resilience4j 入门》.md b/lab-59/《芋道 Spring Boot 服务容错 Resilience4j 入门》.md new file mode 100644 index 00000000..24f442c1 --- /dev/null +++ b/lab-59/《芋道 Spring Boot 服务容错 Resilience4j 入门》.md @@ -0,0 +1 @@ + diff --git a/labx-24/labx-24-resilience4j-demo02/src/main/java/cn/iocoder/springcloud/labx24/resilience4jdemo/controller/DemoController.java b/labx-24/labx-24-resilience4j-demo02/src/main/java/cn/iocoder/springcloud/labx24/resilience4jdemo/controller/DemoController.java index 7e9073d2..b7c21dcd 100644 --- a/labx-24/labx-24-resilience4j-demo02/src/main/java/cn/iocoder/springcloud/labx24/resilience4jdemo/controller/DemoController.java +++ b/labx-24/labx-24-resilience4j-demo02/src/main/java/cn/iocoder/springcloud/labx24/resilience4jdemo/controller/DemoController.java @@ -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() { @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; } diff --git a/labx-24/labx-24-resilience4j-demo02/src/main/resources/application.yml b/labx-24/labx-24-resilience4j-demo02/src/main/resources/application.yml deleted file mode 100644 index e69de29b..00000000 diff --git a/labx-24/《芋道 Spring Cloud 服务容错 Resilience4j 入门》.md b/labx-24/《芋道 Spring Cloud 服务容错 Resilience4j 入门》.md new file mode 100644 index 00000000..d46689cc --- /dev/null +++ b/labx-24/《芋道 Spring Cloud 服务容错 Resilience4j 入门》.md @@ -0,0 +1 @@ + diff --git a/pom.xml b/pom.xml index 4f9efdfa..ffd60736 100644 --- a/pom.xml +++ b/pom.xml @@ -69,6 +69,7 @@ + @@ -94,9 +95,8 @@ + - lab-59 - labx-24