Skip to content

Conversation

@SweetWuXiaoMei
Copy link
Member

add dynamic config for etcd

SweetWuXiaoMei and others added 25 commits October 12, 2024 18:21
… through etcd service registration, and add a demo to test etcd

- Implement the method of finding all instances of EtcdDiscovery
- Implement the registered instance information of EtcdRegistration to etcd
- Implement silent exception information printing, see MuteExceptionUtil for details
- Complete the registration of etcd by the service consumer, and then the consumer can make API calls to the service provider and pass all test cases.
- add code style
- add linelint style
- run spotbugs
- run ratcheck
- update docker config
…related components

- Refactor the findServiceInstances method and use SingletonManager to manage watchers
- Optimize the output format of exception information in log records
- Update the Etcd image version in the test environment
- Removed redundant information in README.md - Added SingletonManager class for managing singleton objects
…ance discovery mechanism

- Add authentication information configuration in EtcdDiscovery
- Implement remote-based observers to monitor changes in service instances
- Use SingletonManager to store and manage instance information
- Update Docker Compose configuration to allow unauthenticated access
- Modify the sayHello method in ProviderController to return the service address
- Removed environment variable acquisition logic
- Modify the return value to the request parameter name
-Remove SingletonManager class and use ConcurrentHashMapEx instead
- Modify the ETCD_DISCOVERY_ROOT path and unify the registration center path format
- Optimize the implementation of findServiceInstances and findServices methods
- Add watchMap for storing watch clients
…related dependencies

- Refactored the EtcdDiscovery class and removed unnecessary variables and methods
- Optimized the acquisition and monitoring logic of service instances
- Updated protobuf version to 3.25.3
- Removed unnecessary protobuf-java dependency in demo project
- Added EtcdClient class to implement etcd client function
- Add EtcdConfig class to handle etcd configuration parameters
- Implement the EtcdDynamicPropertiesSource class to support dynamic configuration
-Added MuteExceptionUtil tool class to handle exceptions
- Update application.yml file to add etcd configuration
- Modify the pom.xml file to add etcd related dependencies
…annotations on the executeFunction method of the MuteExceptionUtil class in the config-etcd and registry-etcd modules.
Comment on lines 50 to 65
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.servicecomb</groupId>
<artifactId>config-etcd</artifactId>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exclude commons-logging in registry-etcd & registry-config

Comment on lines 48 to 54
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
</dependency>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

registry-local may be not dependent on commons-logging. if it is exclude in registry-local, not here.

@liubao68 liubao68 changed the title add dynamic config for etcd [SCB-2892]add dynamic config for etcd Nov 13, 2024
…figuration item - add a new configuration item test1 in application.yml

- Updated test cases to check correct loading of environment, application, service, version and tag configurations
- Modify the path of configuration items to adapt to the new hierarchical structure
- Corrected "zookeeper" in the exception message to "etcd" to ensure that the exception information is consistent with the actual configuration source used - This modification improves the accuracy and readability of the error message and helps to quickly locate and solve the problem
testEnvironment();
testApplication();
testService();
testVersion();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test case for priority? e.g. service configuration override application configuration

…nchronous execution support

- Added ConditionWaiter class for asynchronous task execution and result waiting
- Modify findServices and getInstances methods to asynchronous execution
- Remove redundant code and optimize code structure
- Update related examples and configuration files to remove commons-logging dependency
…Client class

- Added new configuration parameters in application.yml
- Optimized the character encoding in the EtcdClient class, using StandardCharsets.UTF_8 instead of Charset.defaultCharset()
- Updated test cases and added configuration parameter coverage tests
…unused Charset import package in the EtcdClient class in the config-etcd project is removed, which simplifies the code structure and improves the readability and maintainability of the code.
- Update the EtcdConfigIT test case to use specific version numbers instead of general configurations
- Modify the EtcdDiscovery class to improve version information extraction logic
- Optimize code structure to improve readability and performance
@liubao68 liubao68 merged commit e511e8a into apache:master Nov 14, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants