We have been using Hangfire in prod for many years without any hiccups. Love it!
We now face migrating an oldish ETL with its own complex custom job scheduler based on job tables. It was quite well done. We require jobs groups and dependencies. We want to refactor partially to use Hangfire for two main reasons:
- Want to have external visibility UI
- Job Controlability (eg, rerun)
Now, as far as I know, one cannot create a new job (from non-Hangfire database) like the following:
With a string for method and arguments. Please correct me if this is not the case. I considered reflection, but found inviable.
I have created a POC that does the above by using SQL (stored proc) to insert rows directly into the Hangfire tables in a tran. With moderate testing, it seems to work very well. Other than the obvious awkwardness of the solution - can anyone think of reasons not to do this? Is there a better way?