How to configure AddHangfireServer options.Queues if I need other services from within ConfigureServices()?

Hi there, since Hangfire 1.7.26 it’s now possible to use IServiceProvider type in the callback that’s passed to the AddHangfireServer.

services.AddHangfireServer((provider, options) =>
    options.Queues = provider.GetRequiredService<MyDatabase>().Queues);
1 Like