0

In a masstransit saga when UseInMemoryOutbox is enabled, Is there possibility of losing events? As far as I understand UseInMemoryOutbox, It will postpone publishing events after persisting saga, So what would happen if saga persisted and then server restarts?

If it is true, What are workarounds to avoid this situation?

Also if I don't use UseInMemoryOutbox, I face situation where saga wont do anything for incoming events because its state is not persisted yet.

  • You need to evaluate your options. There is a chance that your server restarts or RMQ goes down at the exact time when your saga state has been flushed to the database but the messages aren't published yet. The probability for this exact situation to happen is very low, if you are working in a stable environment. – Alexey Zimarev Aug 02 '18 at 08:44
  • Thanks @AlexeyZimarev, I figured out how to handle my scenario without using UseInMemoryOutbox. I can throw an exception inside the saga when messages are arrived in incorrect state, then rely on Retry policy to wait for message to arrive again. – Mohammad Reza Sadreddini Aug 02 '18 at 11:02

0 Answers0