Wednesday, August 6, 2014

RabbitMQ: com.rabbitmq.client.ShutdownSignalException

Here is the Exception when I encountered learning RabbitMQ:
com.rabbitmq.client.ShutdownSignalException: channel error; reason:
{#method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED -
unknown delivery tag 1, class-id=60, method-id=80), null, ""}

The error you could arise if an application acknowledges messages incorrectly.
So you need to primary check these declarations: to check the "autoAck" attribute , make sure that messages are only acknowledged once.

Server side:

channel.basicConsume(QUEUE_NAME, false, CONSUMER_TAG_QUEUE, consumer);

Client Side:
channel.basicConsume(replyQueueName, false, consumer);

There are legitimate ways in which multiple consumers could get hold of the same message, in the same second. If any consumer rejects a message or reconnects then unacknowledged messages will be returned to the broker and may be delivered to other consumers. Such messages will have the redelivered flag set.

1 comment:

  1. treatment for whiteheads

    How do you handle recovering from a faulty connection using RabbitMQ java client library? » Dilemma

    ReplyDelete