4

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.

Tolu
  • 1,081
  • 1
  • 8
  • 23
  • I did some research and I see I can configure logging using either NLog or Log4Net but I can't seem to see any example of how to configure the logging. Help any one? – Tolu Sep 28 '12 at 15:30
  • The mailing list is likely a better place for questions: http://groups.google.com/forum/#!masstransit-discuss. You can also take a look at the docs site: http://masstransit.readthedocs.org/en/master/ – Travis Sep 29 '12 at 11:25
  • Thanks @Travis. However, like I noted in my answer below, the docs site doesn't seem to include instructions on how to configure logging using NLog. – Tolu Oct 02 '12 at 02:30
  • If you feel up to making a pull request to include that documentation, we'd be happy to accept updates to the docs to cover this. – Travis Oct 02 '12 at 16:15

1 Answers1

6

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.

Tolu
  • 1,081
  • 1
  • 8
  • 23