-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
feature: add Spring Boot 2.4 config data loader support #3754
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great feature and it looks good to me.
However, since it adds a new sdk so I hope it could be reviewed by more committers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create feature, thanks!
I suggest not to mix renaming property / env var names and new feature in a single pull request next time.
renaming property is strong related to the new feature. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great feature!
I am not familiar with spring.config.import functionality so cannot give more help.
.../java/com/ctrip/framework/apollo/config/data/importer/ApolloConfigDataLoaderInitializer.java
Outdated
Show resolved
Hide resolved
.../java/com/ctrip/framework/apollo/config/data/importer/ApolloConfigDataLoaderInitializer.java
Outdated
Show resolved
Hide resolved
.../src/main/java/com/ctrip/framework/apollo/config/data/importer/ApolloConfigDataResource.java
Show resolved
Hide resolved
...o-core/src/main/java/com/ctrip/framework/apollo/core/utils/DeprecatedPropertyNotifyUtil.java
Outdated
Show resolved
Hide resolved
...framework/apollo/config/data/extension/webclient/ApolloClientWebClientTestConfiguration.java
Outdated
Show resolved
Hide resolved
apollo-client/src/test/java/com/ctrip/framework/apollo/internals/ConfigServiceLocatorTest.java
Show resolved
Hide resolved
…ollo/config/data/importer/ApolloConfigDataLoaderInitializer.java Co-authored-by: wxq <Anilople@outlook.com>
…ollo/config/data/importer/ApolloConfigDataLoaderInitializer.java Co-authored-by: wxq <Anilople@outlook.com>
…s/DeprecatedPropertyNotifyUtil.java Co-authored-by: wxq <Anilople@outlook.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What's the purpose of this PR
1. add Spring Boot 2.4 config data loader support
2. make apollo client system property names valid and add warn to the deprecated property names
see the unit test
ApolloClientSystemPropertyInitializerTest#testSystemPropertyNames
see the warn
com.ctrip.framework.apollo.util.ConfigUtil#getDeprecatedCustomizedCacheRoot
com.ctrip.framework.foundation.internals.provider.DefaultApplicationProvider#initDeprecatedAccessKey
com.ctrip.framework.apollo.internals.ConfigServiceLocator#getDeprecatedCustomizedConfigService
2.1 property names changed:
apollo.cacheDir
->apollo.cache-dir
apollo.accesskey.secret
->apollo.access-key.secret
apollo.configService
->apollo.config-service
2.2 environment variables names changed:
APOLLO_CACHEDIR
->APOLLO_CACHE_DIR
APOLLO_ACCESSKEY_SECRET
->APOLLO_ACCESS_KEY_SECRET
APOLLO_CONFIGSERVICE
->APOLLO_CONFIG_SERVICE
3. add webClient extension for apollo client
4. add extension messaging type
long_polling
,websocket
the default value is
apollo.client.extension.messaging-type=long_polling
and thewebsocket
is just a empty Implementationas a placeholder, and will complete in a future version
Which issue(s) this PR fixes:
Fixes #3697
Instruction
1. Basic Functions
1.1 add the dependency
1.2 configure the
app.id
,env
,apollo.meta
same way as before1.3 configure
spring.config.import
on application.properties or application.ymlusing default namespace
application
or
using custom namespace
using multi namespaces
note: please put upside down of your multi namespaces.
2. webClient with spi
2.1 webClient dependency note
webClient can based on reactor netty httpclient, jetty reactive httpclient or apache httpclient5. the necessary dependency are as below
2.1.1 reactor netty httpclient
2.1.2 jetty reactive httpclient
2.1.3 apache httpclient5
2.2 add the dependency
2.3 configure the
app.id
,env
,apollo.meta
same way as before2.4 configure
spring.config.import
and other necessary properties on application.properties or application.yml2.5 provide a spi Implementation of the interface
com.ctrip.framework.apollo.config.data.extension.webclient.customizer.spi.ApolloClientWebClientCustomizerFactory