I have 2 rest API’s that I want to integrate with hangfire.
I created a database for each so that hangfire can create its backend hangfire schema under 2 separate db’s since I want each dashboard to only show jobs for the specific API.
Using the defaults, after hitting both API’s to start them up, the first API that I hit, it’s dashboard says there is 1 server available, but the second dashboard says 0 servers.
I tried to add the following to my startup, and after I do, the dashboard always shows there are no available servers, when I use this code.
var options = new BackgroundJobServerOptions
{
WorkerCount = 25,
ServerName = string.Format("{0}.{1}".FormatWith(Environment.MachineName, Guid.NewGuid()))
};
app.UseHangfireServer(options);
I only get a server when I use app.UseHangfireServer(); but when using hangfire server in more than one web api, only one of the API’s has the server available to them,
Perhaps the question is how do I mimic more than one server on a dev machine?