# Old server tries to process new queue

**URL:** <https://discuss.hangfire.io/t/old-server-tries-to-process-new-queue/1198>\
**Category:** question\
**Tags:** queues\
**Created:** [August 4, 2015, 5:20pm UTC](https://discuss.hangfire.io/t/old-server-tries-to-process-new-queue/1198 "2015-08-04T17:20:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Edo](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@Edo](https://discuss.hangfire.io/u/Edo)\
**Post date:** [August 4, 2015, 5:20pm UTC](https://discuss.hangfire.io/t/old-server-tries-to-process-new-queue/1198/1 "2015-08-04T17:20:45Z")

</div>

I have two servers behind one load balancer.

I published a new version of my web application to one specific server. This _new server_ has the following code:

```auto
app.UseHangfire(config =>
{
    config.UseSqlServerStorage("foo");
    config.UseServer("bar", "default");
});

```

The _new server_ has this function too:

```auto
[Queue("bar")]
[AutomaticRetry(Attempts = 3)]
public static void ProcessFile(string path)
{
    ...
}

```

I understand that the _new server_ is the one in charge of processing jobs of the **bar** queue because the _old server_ doesn’t have the `config.UseServer("bar", "default");` line.  
The _old server_ calls that function with one argument: `config.UseServer("default");`.

But for some reason, the _old server_ is trying to process the jobs of the **bar** queue and an exception is thrown because that server doesn’t have the `ProcessFile` function.

Any idea about what I am doing wrong?

Thanks!

---

<div class="post-metadata">

**Author:** ![JohnMcAvinue](https://avatars.discourse-cdn.com/v4/letter/j/4af34b/32.png) [@JohnMcAvinue](https://discuss.hangfire.io/u/JohnMcAvinue)\
**Post date:** [September 2, 2015, 3:02pm UTC](https://discuss.hangfire.io/t/old-server-tries-to-process-new-queue/1198/2 "2015-09-02T15:02:02Z")

</div>

I’ve been experiencing this too. I removed the server from the underlying database so that it no longer shows in the active server list. However, when I queue a job it’s been handled by the old server, which from looking at the database, Hangfire should no longer know about. It’s very strange!

---

<div class="post-metadata">

**Author:** ![Edo](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@Edo](https://discuss.hangfire.io/u/Edo)\
**Post date:** [September 14, 2015, 6:39pm UTC](https://discuss.hangfire.io/t/old-server-tries-to-process-new-queue/1198/4 "2015-09-14T18:39:00Z")

</div>

I was missing something: **every single server** is in charge of enqueueing jobs. In order to enqueue a job, Hangfire needs to have a reference to the assembly that contains the

`[Queue("bar")] [AutomaticRetry(Attempts = 3)] public static void ProcessFile(string path) { ... }`

method.
