14

I am using RabbitMQ version 3.0.2 & I see close to 1000 message in Error queue. I want to know

  1. At what point messages are moved to the error queues?
  2. Is there a way to know why a certain message is being moved to an error queue?
  3. Is there any way to move message from error queue to normal queue?

Thank you

Mark Robinson
  • 13,128
  • 13
  • 63
  • 81
SharpCoder
  • 18,279
  • 43
  • 153
  • 249

2 Answers2

8
  1. a) they fail to deserialize or b) the consumer throws an exception processing that message five times
  2. Not really... If you peek at the message in the queue, the payload headers might contain a note but I don't think we did that. If you turn logging on (NLog, log4net, etc) you should be able to see the exceptions in your log. You'll have to correlate message ids at that point to figure out exactly why.
  3. There is no built in way via MassTransit. Mostly because there doesn't seem to be a great, generic way to handle this. Everyone wants some process around this. Dru did create a BusDriver app (in the main MT source repo) that could be used to move messages back to the exchange in question. This default behaviour is there so you at least know things have been failing if you don't put in the infrastructure to handle it.
Travis
  • 10,444
  • 2
  • 28
  • 48
  • 1
    Hi Travis, Thank you for reply. In my case, out of 100 messages, 10 are moved to error queue. Now I fail to understand why only few message will fail because of de-serialization & why would consumer throw the exception. I think we need to enable logging in order to gain better understanding. – SharpCoder Dec 11 '13 at 13:26
  • 1
    It's possible that there's an error in deserialization - but that normally only happens if you aren't using MT to put data into the exchange. In all likely hood your consumer is throwing an exception. Good luck, logging is likely your first step to understanding what's going on. The docs should help: http://masstransit.readthedocs.org/en/master/overview/logging.html – Travis Dec 11 '13 at 14:32
  • Thank you for explaining this. But the link you shared is for MassTransit and not for logging RabbitMQ. May be I am wrong but I think we should log RabbitMQ errors – SharpCoder Dec 11 '13 at 14:54
  • The errors queue isn't RabbitMQ errors, but application errors. You can find your RabbitMQ log via http://www.rabbitmq.com/relocate.html – Travis Dec 12 '13 at 00:10
1

To add to Travis' answer, During my development I found some other reasons for messages going onto the error queue:

  1. The published message type has no consumer
  2. A SAGA and a consumer are expecting the same concrete message type. Even if you try and differentiate using "Accepts" and ".Selected", both a SAGA and a Consumer should not be programmed to receive the same message type.
Paul
  • 1,483
  • 14
  • 32