Fast fire and forget

queues
sql-server
Tags: #<Tag:0x00007f499bb16548> #<Tag:0x00007f499bb16110>

#1

Greetings,

I want to dispatch a job quickly fire and forget style (the processing time for the job itself is of lesser concern) in other words I want the time spent in the Enque method to be as little as possible:

https://docs.hangfire.io/en/latest/background-methods/calling-methods-in-background.html

  1. Serialize a method information and all its arguments.
  2. Create a new background job based on the serialized information.
  3. Save background job to a persistent storage.
  4. Enqueue background job to its queue.

I have been testing this with SQLServer as storage but it takes to much time to dispatch. I am considering switching to MSMQ instead, shouldn’t that perform much better? Redis would probably perform best but currently we don’t have a Redis instance running. If we would switch to MSMQ what of the above steps are within the MQ and which are in SQL server? Is 1 - 3 MSMQ and 4 Sql server? Are some of the commercial packages better suited for my requirements?