Search code examples
jhipsterspring-cloud-configjhipster-registry

Can we set the frequency of pull to get better instant updates from config server using Jhipster Registry central-config approach with file-system


Currently I am using in one of my project JHipster micro-service centralization approach using central-config folder, using JHipster Registry app using native file system .

I have two questions to ask---

  1. If we can set the frequency of the pull so we can get better instant updates from the config server?

  2. How the config server treat the data pulling the information from a source (git or binary repository) like it copy the files to a local directory, keep the information in memory ?


Solution

    1. this is not how it works, applications do not poll config server on a regular basis. The configuration gets loaded at startup time. If you make a change in config server and want the applications to reload their application context (see also @RefreshScope bean annotation), it's up to you to either call /management/refresh on each client or you will Spring Bus (if you use it) to send refresh events, see https://cloud.spring.io/spring-cloud-config/reference/html/#_push_notifications_and_spring_cloud_bus
    2. For git backend, the server clones remote repositories when configuration is first requested or at startup and then refreshes according to spring.cloud.config.server.git.refreshRate value, see https://cloud.spring.io/spring-cloud-config/reference/html/#_git_refresh_rate