Search code examples
.netrabbitmqmasstransit

MassTransit exhibits a LIFO (Last-In, First-Out) order for Job Consumers


In my .NET Core application, I’m using MassTransit Job Consumer to run some long-running jobs. However, I noticed that the jobs that are submitted concurrently (within a few seconds) seem to be distributed to the Job Consumer in LIFO order, which is opposed to FIFO in normal message consumers. Is that an expected behavior? If so, how can I make it to use FIFO? FYI - I'm using Sql Server for Saga Repository.


Solution

  • There is no ordering guarantee when using job consumers. They typically run in order based upon how the retry timers work, but there is no effort made to retain any sort of order.