【问题标题】:Spring Config Server reloading native propertiesSpring Config Server 重新加载本机属性
【发布时间】:2015-11-09 20:37:49
【问题描述】:

本机属性是否应该动态重新加载?例如。如果我有:

spring.profiles.active=native
spring.cloud.config.server.native.searchLocations=classpath:/config-native

还有一个名为 sample.properties 的文件:

example-property="Hello from config server"

然后我将 example-property 值更改为其他值,并对配置服务器执行另一个 GET 而不重新启动它,我仍然看到显示的旧值。

这是预期的行为吗?如果我对非本地 (git) 设置执行相同操作,我能够看到更新的属性值。

【问题讨论】:

  • 我怀疑它与classpath:/ 有关。如果是file:/,它将始终有效。使用类路径,可能会使用类加载器缓存内容。
  • 嗨,斯宾塞,是的,这行得通。谢谢!
  • 将我的评论移至答案

标签: spring-boot spring-cloud


【解决方案1】:

我怀疑它与classpath:/ 有关。如果是file:/,它将始终有效。使用类路径,可能会使用类加载器缓存内容。

【讨论】:

    猜你喜欢
    • 2018-12-08
    • 2016-06-03
    • 1970-01-01
    • 2021-02-01
    • 1970-01-01
    • 2020-04-14
    • 2012-10-26
    • 1970-01-01
    • 2016-01-17
    相关资源
    最近更新 更多