RabbitMQ dead letter exchange never getting messages

前端 未结 7 967
陌清茗
陌清茗 2020-12-12 13:08

I\'m trying to setup my first RabbitMQ dead letter exchange, here are the steps I\'m using through the web admin interface:

  1. Create new DIRECT exchange with the
7条回答
  •  长情又很酷
    2020-12-12 13:33

    Create new DIRECT exchange with the name "dead.letter.test"

    Correct

    Create new queue "dead.letter.queue"

    Correct

    Bind "dead.letter.queue" to "dead.letter.test"

    Correct

    Create new queue "test1" with the dead letter exchange set to "dead.letter.test"

    I am assuming you are creating test1 queue and binding it to dead.letter.test exchange

    Send a message into "test1"

    If you want your message to be received by dead.letter.queue you will have to provide routing key while sending message and clients consuming dead.letter.queue should also use same routing key

    If you are publishing without routing key then only clients who are subscribed to test1 will receive the message.

    If you publish message to direct.letter.test exchange then all the queue will receive the message. It will work like a fanout exchange

    So, if you want dead.letter.queue to receive message you will have to publish message in that queue or you will have to use same routing key while publishing and subscribing and publish message to exchange

提交回复
热议问题