Multiple Hangfire service points to single Hangfire database

This is somewhat related: Using One hangfire DB for multiple applications.

Seems like using local DBs is probably the best answer, but if you want to use the shared DB and you always want the machine enqueuing the job to be the one to execute it, you could use the machine name as the queue name.

You can control the queue name at runtime by using the alternative enqueue method - it looks something like this (grabbed from this thread Dynamic queues?):

var state = new EnqueuedState(Environment.MachineName);
BackgroundJobClient.Create(() => Console.WriteLine("Nobody else execute me!"), state);

Note: you’d need to make sure that the server setup method also listens on the MachineName queue.