mirror of
https://gitee.com/yudaocode/SpringBoot-Labs.git
synced 2026-09-03 05:53:54 +08:00
Resilience4j 入门完成
This commit is contained in:
@@ -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 网关
|
||||
|
||||
|
||||
1
lab-59/《芋道 Spring Boot 服务容错 Resilience4j 入门》.md
Normal file
1
lab-59/《芋道 Spring Boot 服务容错 Resilience4j 入门》.md
Normal file
@@ -0,0 +1 @@
|
||||
<http://www.iocoder.cn/Spring-Boot/Resilience4j/?github>
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
1
labx-24/《芋道 Spring Cloud 服务容错 Resilience4j 入门》.md
Normal file
1
labx-24/《芋道 Spring Cloud 服务容错 Resilience4j 入门》.md
Normal file
@@ -0,0 +1 @@
|
||||
<http://www.iocoder.cn/Spring-Cloud/Resilience4j/?github>
|
||||
4
pom.xml
4
pom.xml
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user