Eternet.AspNetCore.Hangfire.PostgreSql
1.0.5
Prefix Reserved
dotnet add package Eternet.AspNetCore.Hangfire.PostgreSql --version 1.0.5
NuGet\Install-Package Eternet.AspNetCore.Hangfire.PostgreSql -Version 1.0.5
<PackageReference Include="Eternet.AspNetCore.Hangfire.PostgreSql" Version="1.0.5" />
<PackageVersion Include="Eternet.AspNetCore.Hangfire.PostgreSql" Version="1.0.5" />
<PackageReference Include="Eternet.AspNetCore.Hangfire.PostgreSql" />
paket add Eternet.AspNetCore.Hangfire.PostgreSql --version 1.0.5
#r "nuget: Eternet.AspNetCore.Hangfire.PostgreSql, 1.0.5"
#:package Eternet.AspNetCore.Hangfire.PostgreSql@1.0.5
#addin nuget:?package=Eternet.AspNetCore.Hangfire.PostgreSql&version=1.0.5
#tool nuget:?package=Eternet.AspNetCore.Hangfire.PostgreSql&version=1.0.5
Eternet.AspNetCore.Hangfire.PostgreSql
Common Hangfire PostgreSQL registration for Eternet ASP.NET Core applications.
The package is storage-topology neutral. It configures Hangfire PostgreSQL consistently, but it does not decide whether a service uses an existing dedicated Hangfire database, the application database with a hangfire schema, or a custom connection factory. That decision belongs to each application's data plane.
Existing dedicated database
Use this when the application already has an operational Hangfire database and must preserve jobs, history, permissions, backup/restore boundaries, or pool budgets.
services.AddEternetHangfirePostgreSql(configuration, options =>
{
options.ConnectionStringName = "HangfirePostgreSql";
options.RegisterServer = true;
options.WorkerCount = 2;
options.Queues = ["default"];
});
Application database and schema
Use this only when the application explicitly owns Hangfire storage in its own database. Schema creation is opt-in so production DDL is not triggered by default.
services.AddEternetHangfirePostgreSql(configuration, options =>
{
options.ConnectionStringName = "PostgreSql";
options.SchemaName = "hangfire";
options.PrepareSchemaIfNecessary = true;
options.RegisterServer = true;
});
Custom connection handling
Applications can preserve a custom resolver, provide Hangfire's IConnectionFactory, or reuse an existing NpgsqlDataSource. The helper does not add or rewrite MaxPoolSize, MinPoolSize, or other pool parameters.
services.AddEternetHangfirePostgreSql(configuration, options =>
{
options.ConnectionStringResolver = (serviceProvider, _) =>
serviceProvider.GetRequiredService<IOptions<DatabaseSettings>>().Value.HangfireConnectionString;
});
services.AddEternetHangfirePostgreSql(configuration, options =>
{
options.ConnectionFactoryResolver = (serviceProvider, _) =>
serviceProvider.GetRequiredService<IConnectionFactory>();
});
services.AddEternetHangfirePostgreSql(configuration, options =>
{
options.DataSourceResolver = (serviceProvider, _) =>
serviceProvider.GetRequiredService<NpgsqlDataSource>();
});
Workers
RegisterServer defaults to false. Enable it only in hosts that should run Hangfire workers. WorkerCount = 2 and Queues = ["default"] are baseline values; applications should tune them per environment and account for the effective worker count across all running instances.
Control plane
Hangfire storage location is independent from Eternet.Mediator stateful commands and the future control plane. The control plane standardizes contracts, identity, execution, observability, and operation; it must not force the physical database used by Hangfire during the transition.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- Hangfire.AspNetCore (>= 1.8.18)
- Hangfire.PostgreSql (>= 1.21.1)
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.3)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.3)
- Npgsql (>= 9.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.