Is there an in memory job storage package for Hangfire?

For NET Core (web application):

Just to make it very obvious because it wasn't obvious to me.

Install following nuget packages:

  • Hangfire.AspNetCore (v1.6.17 atow)
  • Hangfire.MemoryStorage.Core (v1.4.0 atow)

In Startup.cs:

    public void ConfigureServices(IServiceCollection services)
    {
        // other registered services
        ...

        services.AddHangfire(c => c.UseMemoryStorage());
    }

    public void Configure(IApplicationBuilder app, IHostingEnvironment env)
    {
        // other pipeline configuration            
        ...

        app.UseHangfireServer();

        app.UseMvc();
    }

Anything less than above and my enqueued method did not fire.


You can use Hangfire.MemoryStorage for this.

Simply add this nuget package.

And then you can use it like -

GlobalConfiguration.Configuration.UseMemoryStorage();

Tags:

C#

Hangfire