Adding dynamic queues to service post IServiceCollection setup

I know that I can add jobs to non “default” queues by the following:

var enqueuedState = new EnqueuedState
    {
        Queue = "custom-queue",
    };
 BackgroundJobs.Create(() => RunTask(resourceUnit), enqueuedState);

I know that for this to work, I need to setup the server ahead of time like this:

    services.AddHangfireServer(configuration => configuration
        .Queues = new string[]
            { "custom-queue" });

But this only works where I know the queue names ahead of time. I have a case where post theIServiceCollection setup, I learn about new queues that need to be created… i.e. as users come online in different regions, I want to be able to create independent queues in each region (the names of the queues looking something like “custom-queue-australia”, “custom-queue-america”, etc).

How do you add more queues to the default service post its initialization?

@avanderhoorn did you figure it out? I’m interested in the same thing.

The best answer to this that I got was here.

It’d be nice if there was direct support for changing the queues that are monitored. It feels a bit messy disposing singleton objects and calling UseHangfireServer() within an asp.net core app when the docs say to use AddHangfireServer().