I am using RabbitMQ version 3.0.2 & I see close to 1000 message in Error queue. I want to know
- At what point messages are moved to the error queues?
- Is there a way to know why a certain message is being moved to an error queue?
- Is there any way to move message from error queue to normal queue?
Thank you
- a) they fail to deserialize or b) the consumer throws an exception processing that message five times
- 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.
- 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.
To add to Travis' answer, During my development I found some other reasons for messages going onto the error queue:
- The published message type has no consumer
- 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.
来源:https://stackoverflow.com/questions/20514457/masstransit-with-rabbitmq-when-is-a-message-moved-to-the-error-queue