I have a similar situation where I need to have queues for each server. Because the work they do is tied to the files stored on each one. So each of each of my servers consume two queues, “servername” and “default”. For tasks that aren’t server-specific, any server will pick up default.
var options1 = new BackgroundJobServerOptions()
{
ServerName = "server1",
Queues = new[] { "Q01S01", "default" }
};
cfg.UseServer(options1);
var options2 = new BackgroundJobServerOptions()
{
ServerName = "server2",
Queues = new[] { "Q01S02", "default" }
};
cfg.UseServer(options2);
// [Queue("default")]
public void Execute(string param)
{
//do something
}