0

我有以下配置

{"rabbit_version":"3.4.3",

...

"queues":[
    {"name":"consumer.queue-dl","vhost":"dev","durable":true,"auto_delete":false,"arguments":{}},
    {"name":"consumer.queue","vhost":"dev","durable":true,"auto_delete":false,"arguments":{"x-message-ttl":1000,"x-dead-letter-exchange":"consumer.exchange-dl"}},
    {"name":"another-queue", "vhost":"dev","durable":true,"auto_delete":false,"arguments":{"x-message-ttl":1000,"x-dead-letter-exchange":"consumer.exchange-dl"}},
],

"exchanges":[
    {"name":"consumer.exchange-dl","vhost":"dev","type":"direct","durable":true,"auto_delete":false,"internal":false,"arguments":{}},
    {"name":"consumer.exchange","vhost":"dev","type":"topic","durable":true,"auto_delete":false,"internal":false,"arguments":{}},
    {"name":"another-exchange","vhost":"dev","type":"direct","durable":true,"auto_delete":false,"internal":false,"arguments":{}}
],

"bindings":[
    {"source":"consumer.exchange-dl","vhost":"dev","destination":"consumer.queue-dl","destination_type":"queue","routing_key":"","arguments":{}},
    {"source":"consumer.exchange-dl","vhost":"dev","destination":"consumer.queue-dl","destination_type":"queue","routing_key":"#","arguments":{}},
    {"source":"consumer.exchange","vhost":"dev","destination":"consumer.queue","destination_type":"queue","routing_key":"consumer.topic2","arguments":{}},
    {"source":"another-exchange","vhost":"dev","destination":"another-queue","destination_type":"queue","routing_key":"","arguments":{}}
]}

我在annoter-queueconsumer.queue上设置了 DLX,因此他们的消息在 1 秒后移动到consumer.exchange-dl 。

对于绑定到另一个交换(直接)的另一个队列,一切正常;发送到consumer.exchange (topic) 的消息不会移动到 DLX。我尝试使用 DLX 的路由键绑定,但没有任何效果。在 DLX 上进行主题交流有什么陷阱吗?

谢谢

4

1 回答 1

0

我解决了在 DLX 上为consumer.topic2再创建一个绑定到 DL 队列的问题

于 2015-02-24T16:38:49.800 回答