小编Chr*_*ian的帖子

如何从 Spring Boot 应用程序更改 consul K/V Store 中的值

我在 Spring Boot 2 应用程序中使用 Consul 的键/值存储作为 PropertySource。(org.springframework.cloud:spring-cloud-starter-consul-config)

我可以使用 @ConfigurationProperties 从 K/V 存储中读取属性,甚至当我通过 Consul Web 界面更改值时使用 @RefreshScope 更新它们。

但我确实有一些可以在应用程序中更改的动态属性。我如何将这些更改传播到 Consul,以便这些值真正发生变化。我尝试使用该属性的 Setter,但这并没有改变 Consul 中的值。

java spring-boot consul

2
推荐指数
1
解决办法
1959
查看次数

标签 统计

consul ×1

java ×1

spring-boot ×1