The applications are part of a large system but have different codebases. All applications/services use hangfire for performing background processing. Currently, it works so that each application has its own hangfire database. There are no problems with that approach, but we would like to have one dashboard application that is responsible for monitoring all jobs on the system. Also, we would like to have one hangfire base because of easier deployment and maintenance.
Since we have several hangfire servers on different applications/services, the idea is that each server has its own queue. So the server will run only jobs from its queue.
However, there are more problems with that. For example, RecurringJobScheduler loads all jobs, regardless of whether the job is in their queue. As a consequence of a different codebase, we will get an exception on type resolve. The solution to this problem is to change RecurringJobScheduler to load only jobs that are meant for the appropriate hangfire server.
We also encountered a few similar problems with the dashboard application.
The trigger job does not work if it is not the same codebase.
Solution one: All our jobs implement an interface.
Solution two: Changing the TriggerJob method in the Hangfire.Core library, so that it just does the EnqueueBackgroundJob without loading it and trying to execute it.
There are more similar problems. Is there a clean way to do this? If not, do you plan to support this use case in the future?