Update parent POM and add discovery availability annotations#134
Open
mercyblitz wants to merge 6 commits into
Open
Update parent POM and add discovery availability annotations#134mercyblitz wants to merge 6 commits into
mercyblitz wants to merge 6 commits into
Conversation
Update the parent POM reference for io.github.microsphere-projects:microsphere-build from 0.3.1 to 0.3.3 in pom.xml to pick up build configuration updates and fixes in the newer parent release.
Update microsphere-spring-boot.version in microsphere-spring-cloud-parent/pom.xml from 0.1.19 to 0.1.20 to use the latest release and pull in related fixes/updates.
Introduce composed conditional annotations for discovery clients and update auto-configs to use them. Adds ConditionalOnBlockingDiscoveryAvailable and ConditionalOnReactiveDiscoveryAvailable (composing ConditionalOnClass + ConditionalOnDiscoveryEnabled + respective reactive/blocking enablement) and a REACTIVE_DISCOVERY_CLIENT_CLASS_NAME constant. Update DiscoveryClientAutoConfiguration and ReactiveDiscoveryClientAutoConfiguration to use the new annotations and clean up related imports; also remove unused imports from ConditionalOnFeaturesAvailable.
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
Introduce a new ConditionalOnAutoServiceRegistrationAvailable meta-annotation and update web auto-configurations to rely on Microsphere web availability conditions. POM changes add Microsphere webmvc/webflux/actuator modules (reorganize dependency ordering and move aspectj to the bottom) and a small parent POM spacing tweak. WebMvcServiceRegistryAutoConfiguration and WebFluxServiceRegistryAutoConfiguration now use ConditionalOnWebMvcAvailable / ConditionalOnWebFluxAvailable, AutoConfigureAfter against Microsphere web auto-configs and ServiceRegistryAutoConfiguration, and reference the new auto-registration condition. Tests updated to remove explicit EnableWebMvcExtension/EnableWebFluxExtension annotations.
Replace direct class references to WebFluxAutoConfiguration and WebMvcAutoConfiguration in @AutoConfigureAfter with fully-qualified name strings to avoid a hard compile-time dependency and allow those auto-configurations to be optional. Removed the now-unused imports and preserved ordering relative to ServiceRegistryAutoConfiguration.
|
This file contains hidden or 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
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.



This pull request introduces new composite conditional annotations for Spring Cloud Discovery client auto-configuration, refactoring the way conditional logic is applied for both blocking and reactive discovery clients. It also updates dependencies and constants to support these changes.
Conditional Annotation Refactoring:
ConditionalOnBlockingDiscoveryAvailableannotation, which combines checks for the presence ofDiscoveryClient,@ConditionalOnDiscoveryEnabled, and@ConditionalOnBlockingDiscoveryEnabled. This simplifies and centralizes the conditional logic for blocking discovery client auto-configuration. (ConditionalOnBlockingDiscoveryAvailable.java,DiscoveryClientAutoConfiguration.java) [1] [2] [3]ConditionalOnReactiveDiscoveryAvailableannotation, combining checks for the presence ofReactiveDiscoveryClient,@ConditionalOnDiscoveryEnabled, and@ConditionalOnReactiveDiscoveryEnabled, streamlining the conditional logic for reactive discovery client auto-configuration. (ConditionalOnReactiveDiscoveryAvailable.java,ReactiveDiscoveryClientAutoConfiguration.java) [1] [2] [3]Constants and Dependency Updates:
REACTIVE_DISCOVERY_CLIENT_CLASS_NAMEconstant toDiscoveryClientConstantsfor improved maintainability and clarity. [1] [2]0.3.3and themicrosphere-spring-bootBOM version to0.1.20for dependency alignment. (pom.xml,microsphere-spring-cloud-parent/pom.xml) [1] [2]Cleanup:
These changes improve the clarity, maintainability, and extensibility of the conditional auto-configuration logic for both blocking and reactive Spring Cloud Discovery clients.