
疑难杂症
疑难杂症问题
masteryourself
程序员
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
003.Spring Cloud Feign 使用 ApplicationListener 问题
1. 场景前提假设有这样一个场景:在一个 Spring Cloud Feign(Greenwich.SR6)应用中,希望在 Spring 容器启动之后对一些事件做监听,如接收到 ContextRefreshedEvent 事件后,需要做一次初始化操作。一般都是实现 ApplicationListener 接口来监听事件,然后在 onApplicationEvent() 方法里做相应的处理此时可能会遇到两种情况,一个是监听器中的 onApplicationEvent() 方法被调用了多次,还有一个即是在监原创 2020-06-14 12:35:28 · 1250 阅读 · 2 评论 -
001.Spring Boot 整合 Dubbo 使用 war 包部署报错
1. Spring Boot 项目打成 war 包网上提供的思路一般都是如下方式,然后就可以成功启动了,但是对于 Spring Boot + Dubbo 是会报错的,具体请往下看1.1 修改 pom.xml1. 修改 packaging<packaging>war</packaging>2. 修改 dependency<dependencies>...原创 2019-08-28 10:54:56 · 537 阅读 · 0 评论 -
002.Spring 使用 Async 导致循环创建异常
1. 环境搭建代码已经上传至 https://github.com/masteryourself/diseases ,详见 diseases-spring/diseases-spring-async-cycle 工程假设有这样一个场景:在一个被 Spring 容器管理的 SomeService 类中定义了两个方法,一个叫 doSomething(),另一个方法叫 doAnotherThing(),其中 doAnotherThing() 是被 @Async 注解标识的,现在在 doSomething(原创 2020-06-13 13:08:13 · 368 阅读 · 0 评论