【问题标题】:RabbitMQ messages not dead-lettered on ttl expiration for a topic queueRabbitMQ 消息在主题队列的 ttl 到期时没有死信
【发布时间】:2015-02-24 02:00:35
【问题描述】:

我有以下配置

{"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-queueconsumer.queue 上设置了 DLX,因此他们的消息会在 1 秒后移至 consumer.exchange-dl .

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

谢谢

【问题讨论】:

    标签: rabbitmq ttl dead-letter rabbitmq-exchange


    【解决方案1】:

    我解决了在 DLX 上为 consumer.topic2

    再创建一个绑定到 DL 队列的问题

    【讨论】:

      猜你喜欢
      • 2016-07-29
      • 1970-01-01
      • 2022-01-27
      • 2015-04-22
      • 2011-12-29
      • 2020-08-30
      • 2018-08-26
      • 1970-01-01
      • 2018-09-04
      相关资源
      最近更新 更多