Skip to content
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

可否考虑添加一个功能,注册一个回调接口的实现,能自行扩展配置value的转换 #1459

Closed
onethin opened this issue Sep 7, 2018 · 2 comments

Comments

@onethin
Copy link

onethin commented Sep 7, 2018

可以注册一个回调接口,输入参数可以是配置key和value,输出就是value,应用拿到值的是处理过后的value。主要目的是能扩展个性化的参数值处理,比如自定义的加密等,有些公司的配置加密方式有自己的规定。

@nobodyiam
Copy link
Member

这是一个很好的建议,之前的想法是提供一个spi,然后apollo在拿到远端配置后调用该spi对配置做处理,比如解密动作。

不过粒度可能不是一个key和value,更多的可能是给一堆key和value。

欢迎继续讨论~

@nobodyiam
Copy link
Member

With the introduction of ApolloInjectorCustomizer, users could create an injector customizer to customize the apollo objects.
For example, you could create a customized ConfigFactory that wraps DefaultConfigFactory. In the implementation of create and createConfigFile, you could get the original Config and ConfigFile objects and then it's easy to wrap the value processing logic.

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

No branches or pull requests

2 participants