Question

I've implemented a masstransit saga that works as should, a lot of times. However, there are times when the messages go to the error queue or just seem to disappear. I'm using RabbitMQ.

I'd like to know: 1. How do I get the reason/exception message that causes a message to go to the error queue? (NOTE: My handler logic is within a try-catch block so apparently these errors happen even before the handler logic is called) 2. What could be responsible for the lost messages?

Thanks in advance.

Was it helpful?

Solution

I seem to have figured this out: To get the exceptions, configure NLog (or log4Net), add a reference to the appropriate NLogIntegration library and finally in the initialization for the service bus, include sbc.UseNLog(); (for NLog). It seems there is no documentation online that covers this. Had to figure it out by looking at the methods for the NLogIntegration library.

On the issue of messages going to the error queue, the error message was 'Message retry limit exceeded rabbitmq://localhost/workers_sagas:08cf6e3e-d772-e62b-1803-73779fa60000'. Apparently, this was being caused by the fact that I was using the In-Memory repository for Saga Persistence. Hence whenever the process hosting the saga was restarted, all sagas that were yet to complete caused the above error as they were no longer in the repository.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top