2017-05-12 5 views
0

マイ春クラウドコンフィグクライアントがspring.cloud.starter.bus.amqpに依存しているが、それはまだ/bus/refresh endpoint有効/バス/リフレッシュエンドポイント

build.gradle  
compile("org.springframework.cloud:spring-cloud-starter-stream-rabbit:1.1.3.RELEASE")  
compile("org.springframework.cloud:spring-cloud-starter-bus-amqp:1.2.2.RELEASE") 

を有効にされていない、私は私の設定クライアントアプリケーションでこれらの依存関係を持っているが、それでも有効にしない/bus/refresh/bus/env

クライアントアプリケーションで何が欠けているのか教えてください。

注:

spring.cloud.bus.refresh.enabled: true 
spring.cloud.bus.env.enabled: true 
endpoints.spring.cloud.bus.refresh.enabled: true 
endpoints.spring.cloud.bus.env.enabled: true 

Iは、これらが/bus/*エンドポイントを有効にするBusAutoConfiguration、 によって使用されるapplication.yml又はapplication.propertiesにこれらの指標を設定しようとしています。私はこれらのエンドポイントを無効にしている私の春クラウドコンフィグServerアプリケーションで

@ConditionalOnProperty(value = "endpoints.spring.cloud.bus.refresh.enabled", matchIfMissing = true) 

、すなわち、偽

endpoints.spring.cloud.bus.refresh.enabled: false 
endpoints.spring.cloud.bus.env.enabled: false 

に設定されており、春のブート起動中に/bus/*エンドポイントが有効にされていないことを観察しました。

+0

bomをインポートしていますか? 「有効にしない」とはどういう意味ですか?あなたはそれをヒットし、あなたは404を手に入れますか? – spencergibb

答えて

1

クライアントのURLを/bus/refreshにマップしましたか?私はそれがデフォルトで/refreshにマップされていると思います。

またでクライアントアプリにPOSTリクエストを送信して試みることができる:ちょうどspring-cloud-starter-bus-amqp、私もあなたがspring-cloud-starter-stream-rabbit依存関係を必要としないかもしれないと考えてい

curl -X POST http://server:port/refresh 

私は開始点としてあなたを助けるかもしれないRefreshable Configuration using Spring Cloud Config Server, Spring Cloud Bus, RabbitMQ and Gitで作業デモで詳細な投稿を公開しました。

+0

ありがとう[http://stackoverflow.com/users/6679072/ootero]、問題は解決しました – HHS

0

コードを確認した後、spring.cloud.config.bus.enabledがfalseまたは上書きされていることがわかります。

私はエンタープライズフレームワークジャーをSpring Bootのトップに使用していました。 bootstrap.ymlspring.cloud.config.bus.enabledが真であったが、これは設定サーバーのプロパティファイルで上書きされていた。つまりgitプロパティのファイルリポジトリは値としてfalseを持ち、優先順位が与えられていた。

localhost:<port>/env 

は、さまざまなソースのすべてのプロパティを表示する必要があります。サービス・ジャーの一部としての設定サーバーapplication.ymlのようなものです。嗜好を得るものの中から。

"configService:github uri": { list of properties } 
"systemProperties": { list of properties } 
"applicationConfig: [classpath:/application.properties]": { list of properties } 

スプリングの下env残りのリソースは、このプロパティの正確な値を確保するために使用されています。

localhost:<port>/env/spring.cloud.config.bus.enabled