-
Notifications
You must be signed in to change notification settings - Fork 26.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dubbo和openfeign一起用报错 #3990
Comments
我发现,当dubbo的一个提供者,依赖openFeign的bean 会出现这个问题,不依赖则没问题 |
我dubbo和feign混用没遇到这样子的情况额2.7.1 |
一个不完美的解决方法是: @Autowired
@Lazy
F6HttpInterface f6HttpInterface; |
this issue does appear on 2.7.1 but disappears on 2.7.2 and later, we are still investigating. |
2.7.3 still remains. |
This error was caused by Spring Cloud Feign design, every
|
@mercyblitz Thanks for take a look at this. I'm a reader of your book 《SpringBoot编程思想》. Dubbo To see the event and source published by feign, it's easy to implement a EventListener
If we print the
Whatever the And there is a advantage for checking what My advice is to change the
To those who meet this issue and want to fix this issue urgently:
|
@slankka 方案不可行,feign触发onApplicationEvent的时候applicationContext还未注入,是null。 |
@crazyzh1984 |
@slankka 嗯,OK了,可以。 OpenFeign会创建多个child context,每个都会触发refresh, dubbo 的 ServiceBean 是在parent context中管理的,并不在child context中, 问题的根源是: |
* master: (755 commits) add license header for LogUtils file (apache#5272) fix how compatibleParamSignatures is generated. generic codec & bootstrap api Refactor, revert ReferenceConfigCache package change init application scope configs before start referencing. remove sensitive data from log exception for dubbo protocol (apache#5255) add gpg signing plugin for protobuf compiler add default implementation for alibaba pacakge compatible class add gradle wrapper jar file adjust onResponse method for compatibility purpose. Refactor ServiceConfig package remove useless files resolve conflicts after merged master enhance generic invocation check to process a scenario when service type is not available and service invocation is not generic either Fix Dubbo-3990 apache#3990 (apache#5247) ignore compile/.gradle fix Applicaiton Model related issues. use the latest version as the default dependency. Postpone checkSubConfig logic in ReferenceConfig (apache#5226) ...
2.4.1 still remains. |
Environment
spring-cloud-starter-openfeign:2.0.2.RELEASE
Steps to reproduce this issue
例如:
看了下代码,应该是
openFeign 会创建 AnnotationConfigApplicationContext 并且调用refresh();
所以会发送一个openFeign spring上下文的ContextRefreshedEvent事件
然后dubbo接收,就报错了
org.apache.dubbo.config.spring.ServiceBean#onApplicationEvent
Expected Result
Spring正常启动
Actual Result
The text was updated successfully, but these errors were encountered: