HangfireIO / Hangfire

An easy way to perform background job processing in .NET and .NET Core applications. No Windows Service or separate process required
https://www.hangfire.io
Other
9.35k stars 1.69k forks source link

BackgroundJobClient.Enqueue Appears To Be Ignoring Queue Parameter #2384

Open StrangeWill opened 6 months ago

StrangeWill commented 6 months ago

Given the following code:

BackgroundJobClient.Enqueue<JobDoer>("priority-analysis", dj=> dj.DoJob(null!, id, null));

Calling this:

[Queue("analysis")]
public async Task DoJob(PerformContext? performContext, Guid testId, DateTime? _lastRun)
{

Will cause the job to end up in the "analysis" queue.

If I remove [Queue("analysis")] it just uses the default queue.

I'm using the default implementation of IBackgroundJobClient when injected via .NET 7.

StrangeWill commented 6 months ago

https://github.com/StrangeWill/HangfireQueueBug

Reproduction project ^

https://github.com/StrangeWill/HangfireQueueBug/blob/master/HostedServices/HangfireHostedService.cs

^ Relevant config.

image ^ Default queue