問題タブ [spring-cloud-consul]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
0 に答える
1161 参照

spring-boot - @RefreshScope が機能していません。Consul で 2 回目に変更した後、プロパティが更新されない

spring-cloud-consul を使用して Consul と連携していますが、現在この問題が発生しています。consul で config/ConsulServer/my/username としてキーを作成し、値を「bob」にします。私のコントローラーでは、API 呼び出し "/foo" が行われると、この値を返します。初めて「スティーブ」に変更すると、値が更新され、「スティーブ」になります。ただし、2 回目以降は機能しません。値はまだ「スティーブ」です。私が間違っていたことについて誰か助けてもらえますか?私のコードは

私のbootstrap.ymlは

私のapplication.ymlは

spring-cloud-starter-consul-all バージョン 2.1.0.RC3 を使用しています