将仲裁队列与 3.0.0 之前的字符串云流一起使用

Use quorum queues with pre 3.0.0 String Cloud Stream

我们正在使用 Spring Cloud Steam 和 RabbitMQ 活页夹。

我目前正在设置 RabbitMQ 集群并希望使用仲裁队列。设置队列类型的选项必须在创建队列时发送。在Spring Cloud Stream的3.0.0版本中,添加了该选项,但是我们在老版本的String Boot和String Cloud Stream上不想更新,因为我们的live release会在下一个几个星期。

我查看了 PR link。但是选项都是私有的,我没有看到任何侦听器或拦截器。

有什么方法可以将额外的参数注入到队列创建调用中吗?

我建议升级到更新的版本。

旧版本的唯一选择是手动配置和绑定队列并禁用队列的自动配置,如 binder reference 中所述。

If you have an existing exchange/queue that you wish to use, you can completely disable automatic provisioning as follows, assuming the exchange is named myExchange and the queue is named myQueue:

spring.cloud.stream.binding.<binding name>.destination=myExhange

spring.cloud.stream.binding.<binding name>.group=myQueue

spring.cloud.stream.rabbit.bindings.<binding name>.consumer.bindQueue=false

spring.cloud.stream.rabbit.bindings.<binding name>.consumer.declareExchange=false

spring.cloud.stream.rabbit.bindings.<binding name>.consumer.queueNameGroupOnly=true