我有以下配置
{"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":{}}
]}
我在 anoter-queue 和 consumer.queue 上设置了DLX,以便在1秒后将其消息移至 consumer.exchange-dl
一切都适用于另一个队列,它绑定到另一个交换(直接);发送到 consumer.exchange (主题)的邮件不会移动到DLX。我尝试使用DLX的路由键绑定但没有任何效果。 DLX上有关主题变更的任何问题吗?
由于
答案 0 :(得分:0)
我解决了在DLX上再创建一个绑定到 consumer.topic2 的DL队列