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
[3.0] Improve dubbo config beans and bootstrap initialization #8168
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Please fix ut |
Codecov Report
@@ Coverage Diff @@
## 3.0 #8168 +/- ##
============================================
+ Coverage 63.95% 63.99% +0.04%
Complexity 311 311
============================================
Files 1072 1073 +1
Lines 45218 45229 +11
Branches 6810 6813 +3
============================================
+ Hits 28918 28945 +27
+ Misses 13079 13063 -16
Partials 3221 3221
Continue to review full report at Codecov.
|
pinxiong
reviewed
Jul 7, 2021
...-spring/src/main/java/org/apache/dubbo/config/spring/context/DubboConfigBeanInitializer.java
Outdated
Show resolved
Hide resolved
kylixs
changed the title
[3.0] Improve dubbo bootstrap initialization
[3.0] Improve dubbo config beans and bootstrap initialization
Jul 9, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
Initialize dubbo config beans before spring singleton beans.
Initialize dubbo bootstrap after loaded config beans, before Spring context refreshed event.
New dubbo initialization flow:
The goal is to initialize dubbo config beans safely after all BeanPostProcessors are registered.
Previously they are initialized in the
DubboConfigInitializationPostProcessor.postProcessBeforeInitialization()
method. It may fail due to some dubbo config bean being created recursively in java config.The following example demonstrates the failure of init ApplicationConfig by
DubboConfigInitializationPostProcessor
:Now by processing the
DubboAnnotationInitedEvent
event, it is actually executed afterAbstractApplicationContext#registerBeanPostProcessors()
and before theAbstractApplicationContext.finishBeanFactoryInitialization()
method. At this time, other beans have not yet begun to be created. This is a good time to process dubbo config beans.Brief changelog
DubboConfigInitializationPostProcessor
toDubboConfigBeanInitializer
.DubboAnnotationInitedEvent
event for initializing.DubboConfigBeanInitializerTest
javax.annotation-api
.Verifying this change
Fix issue : the xml configuration is not registered when missing
javax.annotation-api
: #8213Checklist