-
Notifications
You must be signed in to change notification settings - Fork 31
Release 0.1.4 #84
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
Merged
Merged
Release 0.1.4 #84
Conversation
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
Introduced DiscoveryUtils for utility methods related to discovery properties and conversions between SimpleDiscoveryProperties and SimpleReactiveDiscoveryProperties. Updated SimpleServiceRegistry to support both property types and refactored constructors. Added new constants for reactive auto-configuration classes and extended related tests to cover new utilities and constructors.
Updated ServiceInstanceUtils.setProperties to set the URI on the target DefaultServiceInstance instead of host, port, and secure fields. Adjusted DiscoveryUtils to use the new setProperties method and updated the related test to verify the new behavior.
Added @nonnull annotations to method parameters in DiscoveryUtils to improve null-safety and clarify API contracts. Also updated method signatures for better consistency.
Default ports are now set to 80 or 443 if the instance port is non-positive. Also, setHost and setPort are now called when copying properties to DefaultServiceInstance, and the URI is set directly from the source instance.
Added test cases to verify that default ports are appended to URIs without explicit port numbers in ServiceInstanceUtils. Also enhanced testGetUri to check for correct default port assignment and consistency with DefaultServiceInstance.getUri.
Included the 'spring-cloud-loadbalancer' dependency as optional in the module's pom.xml to support load balancing features when needed.
Introduced LOAD_BALANCER_ENABLED_PROPERTY_NAME and UTIL_ENABLED_PROPERTY_NAME to define property names for enabling Spring Cloud Load-Balancer and Util features. These additions improve configuration clarity and consistency.
Introduces a JUnit test class to verify the values of constants defined in SpringCloudPropertyConstants. Ensures that property names and prefixes are correctly set.
Introduces a custom annotation that meta-annotates @ConditionalOnProperty for enabling LoadBalancer based on the 'LOAD_BALANCER_ENABLED_PROPERTY_NAME' property. This simplifies conditional bean registration for LoadBalancer-related components.
Introduces ConditionalOnLoadBalancerEnabledTest to verify bean presence based on the 'spring.cloud.loadbalancer.enabled' property. Ensures correct conditional behavior in Spring context.
Introduces a new meta-annotation that applies @ConditionalOnProperty for the UtilAutoConfiguration enabled property. This simplifies conditional configuration based on the UTIL_ENABLED_PROPERTY_NAME property.
Introduces ConditionalOnUtilEnabledTest to verify bean presence based on the 'spring.cloud.util.enabled' property. Ensures correct conditional behavior in Spring container.
Replaced usage of getClass() with explicit test class references in ConditionalOnUtilEnabledTest and ConditionalOnLoadBalancerEnabledTest to ensure correct bean presence checks.
Replaced imports of isBeanPresent from com.alibaba.spring.util.BeanUtils with io.microsphere.spring.beans.BeanUtils in ConditionalOnUtilEnabledTest and ConditionalOnLoadBalancerEnabledTest to reflect package changes.
Introduced ConditionalOnPropertyEnabledTest as a reusable abstract test for @ConditionalOnProperty-based conditions. Updated ConditionalOnFeaturesEnabledTest, ConditionalOnUtilEnabledTest, and ConditionalOnLoadBalancerEnabledTest to extend this new base class, reducing code duplication and improving maintainability. Also updated ConditionalOnFeaturesEnabled to set matchIfMissing=true directly in the annotation.
Updated the toList method in ReactiveDiscoveryClientAdapter to use a non-blocking approach when called from a non-blocking thread, improving compatibility with reactive environments.
Introduced test cases to verify the toList utility method with different schedulers in ReactiveDiscoveryClientAdapterTest. Ensures correct conversion of Flux to List under various scheduling scenarios.
Sync dev-1.x branch
Update Documents
|
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 several enhancements and new utilities to improve integration and compatibility with Spring Cloud components, particularly around discovery and service registry functionality. The main themes are expanded support for reactive discovery, new utility classes, improvements to property handling, and some minor dependency and code quality adjustments.
Spring Cloud Discovery & Registry Enhancements:
DiscoveryUtilsutility class with methods to convert and extract instance maps betweenSimpleDiscoveryPropertiesandSimpleReactiveDiscoveryProperties, improving interoperability between blocking and reactive discovery mechanisms.SimpleServiceRegistryto support bothSimpleDiscoveryPropertiesandSimpleReactiveDiscoveryProperties, allowing it to register services regardless of the discovery implementation. [1] [2]ReactiveDiscoveryClientAdapterto handle blocking and non-blocking threads safely when converting aFluxto aList, preventing potential runtime issues in reactive contexts. [1] [2]Spring Cloud Auto-configuration & Constants:
ReactiveDiscoveryClientAutoConfigurationto support proper ordering with new Spring Cloud reactive discovery auto-configuration classes, and updated related constants inDiscoveryClientConstants. [1] [2] [3] [4] [5]Property and Conditional Annotation Improvements:
ConditionalOnUtilEnabledannotation for conditional bean registration based on the new property. [1] [2] [3]ConditionalOnFeaturesEnabledannotation to always default tomatchIfMissing = trueand removed redundant code. [1] [2]Service Instance Utility Improvements:
setPropertiesmethod toServiceInstanceUtilsfor copying properties between service instances, and improved URI construction to handle default ports when not explicitly set. [1] [2] [3]Dependency Updates:
spring-cloud-loadbalanceras an optional dependency in the project POM to support load balancing features.