Hangfire.SqlServer.RabbitMq
Hangfire.SqlServer.RabbitMq copied to clipboard
Jobs on RabbitMQ queues are limited to only one executing job at a time per queue for each server
Queue consumers - one of which is created for each Hangfire queue - are configured with a prefetchCount
setting of '1':
https://github.com/HangfireIO/Hangfire.SqlServer.RabbitMq/blob/e72d8ee7bab48b751f37b4e37b7ddf0f32523faf/src/Hangfire.SqlServer.RabbitMq/RabbitMqJobQueue.cs#L111
The result of that is that each consumer will only be allowed to have one message (job) unacked - which they are whilst being processed. Even if more workers are configured and available on a given server, they are all made to wait for one job to be completed until another one can be started.
It should be noted that #3 does not change the behavior described above automatically as current consumers of the library might explicitly or implicitly depend on it, and it would be a breaking change requiring a major version bump.
What it does it to introduce an extra configuration setting PrefetchCount
which users are highly encouraged to leverage, however:
sqlServerStorage.UseRabbitMq(rabbit =>
{
rabbit.HostName = "localhost";
rabbit.PrefetchCount = 10;
}, "default", "critical");
^ This allows up to 10 jobs to be executed in parallel for each queue and server.