1

spring bus にその rabbitmq キューの名前を変更するように指示する方法はありますか? 起動時には、次のようなランダムな値のように見えます。

springCloudBus.anonymous.4zzIP0z-TH6oIza5mCun7Q

これをより人間が読める予測可能なキュー名に変更するためにSpring Busを取得しようとしています。例えば:

testQueue

または、メッセージを保持しているサービスに関する知識を持つもの。

bootRun の application.yml に以下を追加してみました。

spring:
   cloud: 
     stream:
       bindings:
         output:
           destination: testQueue

役に立たない。助けてください!!

4

2 に答える 2

3

NOTE: anonymous groups are essential for Spring Cloud Bus to work properly.

using a group makes

a) the subscription durable which means that apps will receive all events (including the ones that have been sent while they were not running)

b) using groups means that apps can become competing consumers which means that the events are not broadcast

c) queues are not deleted automatically anymore

The destination you set in spring-cloud-bus inbound/outbound channels are the rabbitmq exchanges not the queues.

For spring-cloud-bus the outbound channel name is springCloudBusOutput.

Hence, your configuration needs to be: spring: cloud: stream: bindings: springCloudBusOutput: destination: testExchange Here the destination name testExchange is the exchange name not the queue name. To avoid anonymous name in the queue, you can set a group name for inbound channel binding.

spring: cloud: stream: bindings: springCloudBusInput: destination: testExchange group: testQueue

This will make the queue name testExchange.testQueue

于 2016-10-19T05:11:47.687 に答える