3

I like to route my dead letter messages into dlx queues according to the original queue name. My setup:

The dead letter message looks like this

{
    "payload_bytes": 44,
    "redelivered": true,
    "exchange": "dlx",
    "routing_key": "foo-exchange",
    "properties": {
        "delivery_mode": 2,
        "headers": {
            "x-death": [
                {
                    "count": 1,
                    "reason": "rejected",
                    "queue": "foo-queue",
                    "time": 1466502931,
                    "exchange": "foo-exchange",
                    "routing-keys": ["foo-exchange"]
                }
            ]
        }
    },
}

I have the following bindings:

{
    {
        "source": "header-dlx",
        "vhost": "/",
        "destination": "foo-dlx-queue",
        "destination_type": "queue",
        "routing_key": "",
        "arguments": {
          "x-death": [
            {
              "queue": "foo-queue"
            }
          ]
        }
    },
    {
        "source": "header-dlx",
        "vhost": "/",
        "destination": "bar-dlx-queue",
        "destination_type": "queue",
        "routing_key": "",
        "arguments": {
          "x-death": [
            {
              "queue": "bar-queue"
            }
          ]
        }
    }
}

When I deliver the dead letter messsage to my header-dlx exchange which is a simple headers exchange, I expect that the message will dropped into the foo-dlx-queue, but the message got dropped into both binded dlx queues.

Any idea what I'm doing wrong?

nickel715
  • 2,505
  • 1
  • 23
  • 28

0 Answers0