Closed wuhaoqiang1 closed 5 months ago
ci not pass
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.
:white_check_mark: wuhaoqiang1
:white_check_mark: hujun-w-2
:x: realJackSun
You have signed the CLA already but the status is still pending? Let us recheck it.
Please do not create a Pull Request without creating an issue first.
285 服务端配置修改后,不支持@Value值的动态变更
What is the purpose of the change
建议作为动态配置中心,服务端修改配置后支持spring注解@Value值的动态更改,目前nacos-spring-context 1.1.1版本只支持到@NacosValue注解
Brief changelog
2022.4.27更新
Verifying this change
参照监听NacosConfigReceivedEvent事件的NacosValueAnnotationBeanPostProcessor 新增SpringValueAnnotationBeanPostProcessor监听NacosConfigReceivedEvent事件,支持@Value的同步更新
@Value的值的解析使用spring解析使用的StringValueResolver,更贴近于初始化时@Value的解析
已添加部分单元测试,install后,修改服务端值,测试@Value值动态变更通过,测试值 @Value(value = "123${env1:123}${common:not find}321") @Value(value = "${common:not find}") @Value(value = "aa${env1:123}${common:not find}cc")
注解表达式解析器PlaceholderHelper单元测试通过
望参考,谢谢
Follow this checklist to help us incorporate your contribution quickly and easily:
[ISSUE #123] Fix UnknownException when host config not exist
. Each commit in the pull request should have a meaningful subject line and body.mvn -B clean package apache-rat:check findbugs:findbugs -Dmaven.test.skip=true
to make sure basic checks pass. Runmvn clean install -DskipITs
to make sure unit-test pass. Runmvn clean test-compile failsafe:integration-test
to make sure integration-test pass.