1

I am trying to use Spring-Cloud Config to build a configuration server that will allow others apps to register directories/files to be notified of any events (file modification/creation/deletion) that occur.

I'm currently limited to storing our configuration files on filesystems, so pointing to a git repo won't work.

This is my current applications.properties:

server.port=8888 spring.profiles.active=native spring.cloud.config.server.native.searchLocations=C:/Users/xxxx/Documents/other/test-config-dir

From what I've researched so far, Spring-Cloud config server points to a location to watch on startup through this application.properties file. Is there any way for me to add searchLocations without restarting the server?

For git repos, I think this would be possible since you can hit endpoints to get configs from branches of said repo right? But would this even be possible when pointing to a location on the filesystem?

Panda
  • 33
  • 6
  • https://stackoverflow.com/questions/27131143/spring-cloud-configuration-server-not-working-with-local-properties-file – pvy4917 Nov 08 '18 at 19:22
  • That doesn't answer my question. I can already read property files from local filesystem. I'm asking whether I can add additional locations to read from without restarting the config-server. My query is similar to this person's: https://github.com/spring-cloud/spring-cloud-config/issues/139#issuecomment-124254165 – Panda Nov 08 '18 at 19:49
  • https://stackoverflow.com/questions/25855795/spring-boot-and-multiple-external-configuration-files – pvy4917 Nov 08 '18 at 19:50
  • ??? The poster in this link has issues loading property files from the classpath, while I have issues with dynamically adding property files while the server is already running. Unless I'm missing something, the links you're providing are not answering my question – Panda Nov 08 '18 at 20:21

1 Answers1

0

The git-based services use hooks to post at a specific endpoint. You could use this endpoint (/monitor) to trigger the refreshes on your own, for example by sending a request there at regular interval or by implementing a logic that would send that request whenever the file changes - similarly to how github hooks work-. You can find more information about setting up the /monitor enpoint in the Spring Cloud Config Docs in the section "Push Notifications and Spring Cloud Bus".

OlgaMaciaszek
  • 3,662
  • 1
  • 28
  • 32