限制hangfire从特定队列中获取作业

use*_*992 2 hangfire

我有 2 个hangfire 实例/服务器正在运行。两者都指向同一个hangfire 数据库。如何限制 Hangfire 实例之一仅从特定队列中获取作业并忽略其他队列?

谢谢

GôT*_*ôTô 5

当您启动实例时,您可以提供要由服务器监视的队列列表:

app.UseHangfireServer(new BackgroundJobServerOptions()
    {
        // order defines priority
        // beware that queue names should be lowercase only
        Queues = new [] { "critical", "default", "myqueue" } 
    });
Run Code Online (Sandbox Code Playgroud)