问题描述
当前,我在我的项目JHipster微服务集中化方法中使用Central-config文件夹,并在JHipster Registry应用程序中使用本机文件系统。
我有两个问题要问---
解决方法
- 这不是它的工作方式,应用程序不会定期轮询配置服务器。在启动时加载配置。如果您在配置服务器上进行更改并希望应用程序重新加载其应用程序上下文(另请参见
@RefreshScope
bean注释),则可以由您在每个客户端上调用/ management / refresh,否则将使用Spring Bus(如果您可以使用它)发送刷新事件,请参见https://cloud.spring.io/spring-cloud-config/reference/html/#_push_notifications_and_spring_cloud_bus - 对于git后端,服务器会在首次请求配置时或在启动时克隆远程存储库,然后根据
spring.cloud.config.server.git.refreshRate
值进行刷新,请参见https://cloud.spring.io/spring-cloud-config/reference/html/#_git_refresh_rate