How to set local config properties with Spring Config Service

前端 未结 2 976
滥情空心
滥情空心 2021-01-27 00:44

So I recently learned this awesome config service of Spring Cloud, and after some struggling I\'m able to get our distributed application set up, with multiple nodes reading con

2条回答
  •  闹比i
    闹比i (楼主)
    2021-01-27 01:23

    OK, after some more research I found the answer. From https://docs.pivotal.io/spring-cloud-services/config-server/configuration-clients.html

    A Spring application can use a Config Server as a property source. Properties from a Config Server will override those defined locally (e.g. via an application.yml in the classpath).

    So the right thing to do is to leave any client side property out of the config service. This to me also means for such properties there is no way to have a default that will only be overwritten if a client side value presents, which would be good to have.

提交回复
热议问题