Malik Firose
Malik Firose

Reputation: 389

Configuring multiple queues with a topic exchange and using routing key to direct the message specific queue with spring cloud streams

Configuring multiple queues with a topic exchange and using routing key to direct the message specific queue with spring cloud streams

My requirement is example I have the queues and exchange defined as below in consumer end

spring.cloud.stream.bindings.inputA.destination=Common-Exchange
spring.cloud.stream.bindings.inputA.group=A-Queue

spring.cloud.stream.bindings.inputB.destination=Common-Exchange
spring.cloud.stream.bindings.inputB.group=B-Queue

Of course we can use one queue and use headers to direct different type of messages but I need to know how multiple queue connected to a single exchange work with streams.

Upvotes: 0

Views: 1941

Answers (1)

Gary Russell
Gary Russell

Reputation: 174554

See the Rabbit binder documentation.

  • On the consumer side, set the bindingRoutingKey consumer binding property.
  • On the producer side, the the routingKeyExpression producer binding property (e.g. headers['routingKey'] and set that header as needed).

Also see Using Existing Queues/Exchanges.

Upvotes: 3

Related Questions