Spring cloud config server - how to add custom PropertySource visible in findOne() method of EnvironmentEncryptorEnvironmentRepository

ぐ巨炮叔叔 提交于 2019-12-06 00:03:02

What you are doing is adding a property source to the config server itself, not the configuration it serves. Adding spring-boot-starter-actuator to your config server and viewing /env reveals:

{
  "profiles": [

  ],
  "server.ports": {
    "local.server.port": 8888
  },
  "bootstrapProperties:custom": {
    "test.prop3": "CUSTOM-VALUE-3",
    "test.prop2": "CUSTOM-VALUE-2",
    "test.prop1": "CUSTOM-VALUE-1"
  },
}

To add something that will be served by config server, you have to implement an EnvironmentRepository.

Support for a composite EnvironmentRepository was recently added.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!