spring-cloud-stream icon indicating copy to clipboard operation
spring-cloud-stream copied to clipboard

Add Alternate Exchange RabbitMQ support

Open serut opened this issue 2 years ago • 2 comments

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 avatar Jul 05 '22 14:07 serut

@serut , it looks like the StreamBridge should be allow you do this?

tzolov avatar Jul 26 '22 10:07 tzolov

@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

garyrussell avatar Jul 27 '22 14:07 garyrussell