Two separate instances of hangfire within the same project?

I’m not 100% sure the title explains this question fully, so I’ll try and elaborate. Apologies if it still doesn’t make sense!

I have a .net core webapp that has HF set up within it. It uses a fairly standard hangfire setup with an SQL backend to make some fire and forget calls that do some background data work. Let’s call this ‘WebApp’. I configure this through program.cs and pass it a connection string from appsettings when building.

Separate to this hangfire service I have built a separate project full of microservices that use hangfire for processing notifications and messages. I wanted to keep this hangfire instance and database separate from the first for a number of reasons that I’m not sure I need to go into here. Let’s call this ‘Mailer’.

My issue comes when I try to register ‘Mailer’ as being a service my WebApp can use to queue mail related jobs. The whole solution builds and when I try to inject a backgroundjobclient into my pages and components nothing breaks, but it seems behind the scenes it is actually injecting the IBackgroundJobClient from the WebApp’s version of Hangfire, NOT the Mailer’s one and all jobs are queued in the WebApp HF database, which means they never run (queues have different names and if they don’t it can’t find the relevant code in the WebApp, obviously).

I tried separately to use DI to make the Mailer’s individual services available in the WebApp, and this also seems to work, but when the jobs end up being queued they end up being queued within the WebApp’s HF database, instead of the Mailer’s one.

Is anyone able to advise on how I could set this up? At it’s most basic, I just need the WebApp to use a connection string for its own HF database and a separate one for the Mailer’s HF database when it is interacting with the Mailer. Is there a way I can pass different connection strings to each instance of HF when I am registering them in the WebApp?