Separated reponsabilities with hangfire jobs

Tags: #<Tag:0x00007f7b52cb5208> #<Tag:0x00007f7b52cb5118>

Hi,
Anyone can explain me how can I Hangfire in such way, that i use the web application for scheduled the jobs, and another machine process it ? Or how can i force the jobs run under a specific machine ?

Thanks

Short answer:

  1. Create a console application and configure Hangfire on that and connect to a database. This will your code base that will perform the business logic.

This will also create a hangfire server on startup or inside main method

`var options = new BackgroundJobServerOptions
        {
            WorkerCount = 1
        };

var server = new BackgroundJobServer(options);`

  1. Create another Web application and connect to the same data base. This will be your Dashboard application where you can view and trigger jobs manually

You require to call below extension method in your startup
services.AddHangfire(..);
app.UseHangfireDashboard();

You can host both apps in different machines. Hope that helps. I will write more broad writeup if you need later. I am in bit hurry right, My apologies!!