Skip to content

jhartmann123/Hangfire.PostgreSql

 
 

Hangfire.PostgreSql

Build status

This is an plugin to the Hangfire to enable PostgreSQL as a storage system. Read about hangfire here: https://github.com/HangfireIO/Hangfire#overview and here: http://hangfire.io/

Instructions

For .NET

Install Hangfire, see https://github.com/HangfireIO/Hangfire#installation

Download all files from this repository, add the Hangfire.PostgreSql.csproj to your solution. Reference it in your project, and you are ready to go by using:

app.UseHangfireServer(new BackgroundJobServerOptions(), 
  new PostgreSqlStorage("<connection string or its name>"));
app.UseHangfireDashboard();

For ASP.NET Core

First, NuGet package needs installation.

  • Hangfire.PostgreSql (Uses Npgsql 6)
  • Hangfire.PostgreSql.Npgsql5 (Uses Npgsql 5)

Both packages are functionally the same, the only difference is the underlying Npgsql dependency version.

In Startup.cs ConfigureServices(IServiceCollection services) method add the following line:

services.AddHangfire(config =>
		        config.UsePostgreSqlStorage(Configuration.GetConnectionString("HangfireConnection")));

In Configure method, add these two lines:

app.UseHangfireServer();
app.UseHangfireDashboard();

And... That's it. You are ready to go. Also there exists sample application here.

If you encounter any issues/bugs or have idea of a feature regarding Hangfire.Postgresql, create us an issue. Thanks!

Enabling SSL support

SSL support can be enabled for Hangfire.PostgreSql library using the following mechanism:

config.UsePostgreSqlStorage(new DefaultConnectionBuilder(
    options.HangfireDatabaseConnectionString,
    connection =>
    {
        connection.ProvideClientCertificatesCallback += clientCerts =>
        {
            clientCerts.Add(X509Certificate.CreateFromCertFile("[CERT_FILENAME]"));
        };
    }));

License

Copyright © 2014-2021 Frank Hommers http://hmm.rs/Hangfire.PostgreSql.

Collaborators: Frank Hommers (frankhommers), Vytautas Kasparavičius (vytautask) and Žygimantas Arūna (azygis)

Contributors: Burhan Irmikci (barhun), Zachary Sims(zsims), kgamecarter, Stafford Williams (staff0rd), briangweber, Viktor Svyatokha (ahydrax), Christopher Dresel (Dresel), , Vincent Vrijburg, David Roth (davidroth) and Tinyakov.

Hangfire.PostgreSql is an Open Source project licensed under the terms of the LGPLv3 license. Please see http://www.gnu.org/licenses/lgpl-3.0.html for license text or COPYING.LESSER file distributed with the source code.

This work is based on the work of Sergey Odinokov, author of Hangfire. http://hangfire.io/

Related Projects

About

PostgreSql Storage Provider for Hangfire

Resources

License

Unknown and 2 other licenses found

Licenses found

Unknown
LICENSE.md
LGPL-3.0
COPYING
LGPL-3.0
COPYING.LESSER

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 96.2%
  • PowerShell 2.9%
  • Shell 0.9%