Indrivo.BackgroundProcessor.Utility.Service.Hangfire.PostgreSQL.Plugin
1.0.3
dotnet add package Indrivo.BackgroundProcessor.Utility.Service.Hangfire.PostgreSQL.Plugin --version 1.0.3
NuGet\Install-Package Indrivo.BackgroundProcessor.Utility.Service.Hangfire.PostgreSQL.Plugin -Version 1.0.3
<PackageReference Include="Indrivo.BackgroundProcessor.Utility.Service.Hangfire.PostgreSQL.Plugin" Version="1.0.3" />
paket add Indrivo.BackgroundProcessor.Utility.Service.Hangfire.PostgreSQL.Plugin --version 1.0.3
#r "nuget: Indrivo.BackgroundProcessor.Utility.Service.Hangfire.PostgreSQL.Plugin, 1.0.3"
// Install Indrivo.BackgroundProcessor.Utility.Service.Hangfire.PostgreSQL.Plugin as a Cake Addin #addin nuget:?package=Indrivo.BackgroundProcessor.Utility.Service.Hangfire.PostgreSQL.Plugin&version=1.0.3 // Install Indrivo.BackgroundProcessor.Utility.Service.Hangfire.PostgreSQL.Plugin as a Cake Tool #tool nuget:?package=Indrivo.BackgroundProcessor.Utility.Service.Hangfire.PostgreSQL.Plugin&version=1.0.3
Background Processing
Introduction
During the development of multiple solutions @Indrivo we have ussually encoutered the need of having a background or ASYNCHRONOUS process that runs on different triggers like : cron expression, http trigger, message that came via a message bus etc. .NET Core comes with a basic functionality that covers the need of a background worker to some extent, however that is most often not enough and is pretty uncomfortable to develop and monitor.
Purpose
The main purpose of the module came from the need of a having MediatR run specific commands (long running requests) in the background asynchronously, known under the term Fire-and-Forget processes. As well the administrators would need to have a monitoring dashboard built on top of the functionality. Seamless integration and extension of MediatR functionality is desired. In time the module developed a way to run CRON jobs in a simillar fashion. So the main functionality right now consists of:
- MediatR extension method for ASYNC processing -- .Enqueue();
- Easy to use CRON job setup that can be integrated in projects that run with/without MediatR.
- Monitoring dashboard for easier debugging and resolving of issues.
How to set up
Set up is pretty straightforward you will need to install the following packages inside your solution:
- Indrivo.BackgroundProcessor.Utility.Contracts
- Indrivo.BackgroundProcessor.Utility.Service.Hangfire
- Indrivo.BackgroundProcessor.Utility.Service.Hangfire.PostgreSQL.Plugin
- Indrivo.BackgroundProcessor.Utility.Service.Hangfire.SQLServer.Plugin
Each plugin comes with his own small installer. So you are free to use them explicitly. However the desired way is to add the following structure to your appsetting file. Example:
"HangfireConfigurationOptions": {
"DatabaseProvider": "SQLServer",
"DatabaseConnectionString": "Server=(localdb)\\mssqllocaldb;Database=aspnet-hangfireTest;Trusted_Connection=True;MultipleActiveResultSets=true"
}
Where the DatabaseProvider can be either of the : "SQLServer" | "PostregSQL".
Example of this setup can be seen in the reference web application present in the current repo.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- Hangfire.AspNetCore (>= 1.8.0-beta4)
- Hangfire.PostgreSql (>= 1.9.7)
- MediatR (>= 10.0.1)
- MediatR.Extensions.Microsoft.DependencyInjection (>= 10.0.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Indrivo.BackgroundProcessor.Utility.Service.Hangfire.PostgreSQL.Plugin:
Package | Downloads |
---|---|
Indrivo.BackgroundProcessor.Utility.Service.Hangfire
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.