spring-cloud-stream
spring-cloud-stream copied to clipboard
Add Alternate Exchange RabbitMQ support
Expected Behavior
There is tons of applications related to alternate-exchange that looks not address by the spring amqp right now. https://www.rabbitmq.com/ae.html
I would like to declare in my config file :
spring:
cloud:
rabbit:
bindings:
<something>:
producer:
alternate-exchange-exchange: where.my.message.goes.when.routing.key.no.match
alternate-exchange-type: topic
alternate-exchange-queue-name: where.my.message.end.when.routing.key.no.match
Current Behavior
There is no way to declare an alternate exchange without using the low level AMQP API. It would be killer feature to be able to do it from inside application config file
Context
It would be used in case the producer send its first messages before the receiver creates its queue. The producer must declare an alternate-exchange on the exchange and a queue associated to the exchange to store messages that has not been routed to an existing queue using routing key. My spring-amqp feature request : https://github.com/spring-projects/spring-amqp/issues/1468
@serut , it looks like the StreamBridge should be allow you do this?
@tzolov This is a request for adding more convenience to configure the alternate exchange; today it needs to be done with a DeclarablesCustomizer
bean. See https://github.com/spring-projects/spring-amqp/issues/1468#issuecomment-1175001910