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                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Indrivo.BackgroundProcessor.Utility.Service.Hangfire.PostgreSQL.Plugin" Version="1.0.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
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"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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:

  1. MediatR extension method for ASYNC processing -- .Enqueue();
  2. Easy to use CRON job setup that can be integrated in projects that run with/without MediatR.
  3. 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:

  1. Indrivo.BackgroundProcessor.Utility.Contracts
  2. Indrivo.BackgroundProcessor.Utility.Service.Hangfire
  3. Indrivo.BackgroundProcessor.Utility.Service.Hangfire.PostgreSQL.Plugin
  4. 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.

Version Downloads Last updated
1.0.3 2,128 4/18/2023
1.0.2 1,140 12/6/2022
1.0.1 994 12/6/2022
1.0.0 1,054 6/7/2022