# Enqueue with specified queue name

**URL:** <https://discuss.hangfire.io/t/enqueue-with-specified-queue-name/11371>\
**Category:** question\
**Tags:** redis, queues\
**Created:** [August 15, 2025, 6:26pm UTC](https://discuss.hangfire.io/t/enqueue-with-specified-queue-name/11371 "2025-08-15T18:26:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeff\_Posey](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/jeff_posey/32/1892_2.png) [@Jeff\_Posey](https://discuss.hangfire.io/u/Jeff_Posey)\
**Post date:** [August 15, 2025, 6:26pm UTC](https://discuss.hangfire.io/t/enqueue-with-specified-queue-name/11371/1 "2025-08-15T18:26:46Z")

</div>

I’m trying to enqueue a job and override the queue that is set in the attribute  
ie BackgroundJob.Enqueue(“new\_queue”, x =\> x.Execute(null, x, y))

and I’m getting the error:  
System.NotSupportedException: Current storage doesn’t support specifying queues directly for a specific job. Please use the QueueAttribute instead.

We’re currently using Hangfire.Pro.Redis v2.6.2.0. Is this still a limitation? or perhaps is available in a newer version?

Thanks,

---

<div class="post-metadata">

**Author:** ![odinserj](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/odinserj/32/648_2.png) [@odinserj](https://discuss.hangfire.io/u/odinserj)\
**Post date:** [August 18, 2025, 9:48am UTC](https://discuss.hangfire.io/t/enqueue-with-specified-queue-name/11371/2 "2025-08-18T09:48:36Z")

</div>

Yes, storage support is required here, and your package is pretty outdated. You can just update to Hangfire.Pro.Redis of the latest version, please see [Release Notes for Hangfire Pro — Hangfire](https://www.hangfire.io/blog/releases/hangfire-pro.html) for the full change log.

---

<div class="post-metadata">

**Author:** ![Jeff\_Posey](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/jeff_posey/32/1892_2.png) [@Jeff\_Posey](https://discuss.hangfire.io/u/Jeff_Posey)\
**Post date:** [August 19, 2025, 3:45pm UTC](https://discuss.hangfire.io/t/enqueue-with-specified-queue-name/11371/3 "2025-08-19T15:45:06Z")

</div>

Hi Sergey, thanks for the response.

Although, I no longer get the error after upgrading, it’s still not doing what I expected.

I have a method:

[Queue(“queue\_a”)]  
public interface ISomeMethod {  
void Execute(…)  
}

But when I enqueue it I want to essentially override which queue it gets processed on:

```auto
var id = BackgroundJob.Enqueue<ISomeMethod>("queue_a_canary", x => x.Execute(...));

```

It seems no matter what I do, it still gets enqueued to the queue\_a queue.  
The idea is to support a “stable” and a “canary” queue with the jobs being sent dynamically to the appropriate queues.  
Is this supported or am I just doing something wrong?

Thanks,

---

<div class="post-metadata">

**Author:** ![odinserj](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/odinserj/32/648_2.png) [@odinserj](https://discuss.hangfire.io/u/odinserj)\
**Post date:** [August 20, 2025, 3:56am UTC](https://discuss.hangfire.io/t/enqueue-with-specified-queue-name/11371/4 "2025-08-20T03:56:45Z")

</div>

The `Queue` filter attribute defines an override, and not the default queue. This is a regular extension filter that affects the basic processing pipeline, and isn’t meant to set any defaults. My recommendation here is to either define the queue name when calling the `Enqueue` method, or create a custom attribute that implements routing, for example, based on argument value:

```csharp
public sealed class CustomQueueAttribute : JobFilterAttribute, IElectStateFilter
{
    public string DefaultQueue { get; set; }

    public void OnStateElection(ElectStateContext context)
    {
        if (context.CandidateState is EnqueuedState enqueuedState)
        {
            enqueuedState.Queue = context.BackgroundJob.Job.Args[0] == "AnotherTenant"
                ? "another-tenant"
                : DefaultQueue;
        }
    }
}

```
