Skip to content

Cant receive messages from queue bound to a dead letter exchange #60

@OfenPower

Description

@OfenPower

Describe the bug

Hello dear programmers,

If I try to receive a message from a queue which is bound to a fanout dead letter exchange (no binding key used), the following error occures:

"amqp:internal-error: array decoding not implemented for 0xd1"

My guess is that it has something to do with the additional message header information which gets attached to a message when it is dead lettered to the exchange. Maybe the rabbitmq-amqp-go-client cannot decode these correctly?

Thank you and best regards

Reproduction steps

  1. Declare 2 fanout exchanges with the following names: exchange-1 and dead-letter-exchange-1
  2. Declare a quorum queue with the name queue-1. Set the DeadLetterExchange-Parameter to dead-letter-exchange-1 and the DeliveryLimit to 1
  3. Declare a quorum queue dead-letter-queue-1
  4. Bind exchange-1 to queue-1 without a binding key since we are using a fanout exchange
  5. Bind dead-letter-exchange-1 to dead-letter-queue-1, also without a binding key
  6. Create a publisher with the NewPublisher()-function and set the amqp.ITargetAddress-Parameter to &amqp.ExchangeAddress{Exchange: "exchange-1"}
  7. Publish a message with the publisher from step 6. to the exchange exchange-1
  8. Go to the rabbitmq management UI -> Queues and Streams -> click on queue-1 -> scroll down to Get messages -> click the Button Get message 2x, meaning that the message will be requeued two times and therefore dead-lettered to the exchange dead-letter-exchange-1. You should now see that a message has been delivered to the queue dead-letter-queue-1
  9. Create a consumer with the NewConsumer()-Function and set its queueName-Parameter to dead-letter-queue-1
  10. Try to consume the message deliveryContext, err := consumer.Receive(context.Background())
  11. Try to accept the message deliveryContext.Accept(context.Background) -> error happens

Expected behavior

After calling consumer.Receive() I expect to receive the dead-lettered message from the queue dead-letter-queue-1

Additional context

I can receive the message normally through the management UI, but not through the library. I can consume from any other queue perfectly fine with the library. The bug only seems to happens when I try to receive messages with the library from a queue which is bound to a dead letter exchange.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions