简体   繁体   中英

Spring Cloud Config Server - Possibility to reference files with Git backend

As an organisational unit, we have set up Spring Cloud Config Server for all our Spring micro-services with a Git backend (using bitbucket.org). We have also enabled the /actuator/refresh endpoints to refresh our @ConfigurationProperties on the fly without having to redeploy any micro-service. It was decided not to make use of Spring Cloud Bus to ensure that we have full control when to refresh which application as a precaution.

Now comes our question. We have some micro-services which have queries as configurations. These can be quite cumbersome and we would like to place such queries in a file and have them referenced by the Spring Cloud Config Server. Has anyone managed to come up with such a solution or perhaps something similar? It is imperative for us to still be able to refresh such configurations on the fly, even if being referenced. Thus, these cannot be packaged with the application itself.

That's funny, we set up almost the same as you did... Although it seems to be good, be very careful with that... Using the @RefreshScope on every beans will certainly be useful at first, but then, if you think of the users using your application, they might be impacted by the refresh, as your bean won't exist, the time they get re-created. They might experiences some 500 Internal or similar sometimes.

Anyway, try this: https://cloud.spring.io/spring-cloud-config/multi/multi__spring_cloud_config_server.html#_file_system_backend That is what we used in my team. It is connecter to your filesystem... But I don't know the behavior of combining the native search and a git repository... Don't even know if possible. You might have one, but maybe not both. Give it a try.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM