-
Notifications
You must be signed in to change notification settings - Fork 8.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
nacos config support sharing configuration with multi Applications #12
Comments
Support global and partial config, that means duplicated properties set into global config. Users can only change global config to take lots of services effect |
Nacos can refer to spring cloud, global config affects all applications, and individual config affects single application. Set a global label, like group, every application belong to this group, share the same config.When application starts, register itself to it's group. |
感觉现在的配制方式不是很灵活,如果要多个应用共享配制文件的话,通过指定 spring.cloud.nacos.config.prefix + profile 的方式就有点类似分组了,但是 Nacos 本身就有 group 的概念... |
根据以上讨论,Spring Cloud Alibaba 组成员初步决定:通过 自命名 dataid 来实现多个应用间可共享配置。届时SCA Nacos Config 会新增加一个配置,用来列举多个应用共享配制文件的dataid。如下所示:
经过这么一配置,应用程序再启动的时候依次加载DataId为 global.yaml,app-common.yaml,app-local-common.yaml 的配置。 当使用这种方式来实现应用间的共享配置时,多个共享配置间我们约定:
同时对于共享配置,我们也提供可配置的方式来自由的选择某个共享配置是否支持动态刷新。在实现的过程中默认是不支持共享配置的动态刷新的,因为这部分的配置变更有可能会影响另外应用对共享配置的引用。 这种方式的优点在于:
|
期待~~~~ |
group 何处安放呢? |
|
关于group这个,如果我想这样(就是想要不同group下的两个配置合并到一起),具体怎么配置? ------|------------dataid------------------ |------ group ------| Middleware Common Configs:cfg1: common_middleware_component.cfg + middleware_group //公共组件的公用配置 BU configs:cfg2: business_middleware.cfg + BU1_group //特殊场景的特殊配置 cfg3: business_app1.cfg + BU1_group want to merge cfg1 + cfg2 + cfg3 |
经过小组内部的进一步讨论,这种情况确实比较常见。我们在原来的设计基础上进行了升级。总体方案大致是:像dataid,group,是否支持刷新等额外配置都以配置的形式开放出来让业务方根据自己的需要做定制化的配置。使用方式如下所示: spring.cloud.nacos.config.ext-config[0].data-id=data-id-zero.properties spring.cloud.nacos.config.ext-config[1].data-id=data-id-one.properties spring.cloud.nacos.config.ext-config[2].data-id=data-id-three.properties |
No description provided.
The text was updated successfully, but these errors were encountered: