I have hangFire working fine, I can add jobs and they execute fine however I now have a need for multiple queues which doesn’t seem to work.
My setup is an MVC5 project, in the OWIN startup I perform the following…
public void ConfigureHangfire(IAppBuilder app)
{
app.UseHangfire(config =>
{
config.UseSqlServerStorage(Utility.GetConnectionStringFromEfConnectionString());
config.UseServer("Billing", "SystemActions");
config.UseAuthorizationFilters(new AuthorizationFilter
{
Roles = "Administrator"
});
config.UseNinjectActivator(NinjectWebCommon.Kernel);
});
}
The method I intend to action as a task is located in my Business Layer and is coded as the following…
[Queue("Billing")]
public void StandardBilling(Int64 companyId)
{
...
}
I then call the method from somewhere else in the Business Layer like…
BackgroundJob.Schedule(() => _subscription.StandardBilling(123), TimeSpan.FromDays(1));
The task that is created in Hangfire is put into the Default Queue. No matter what I do (I’ve tried the Enqueue function) it never makes it into the ‘Billing’ queue.