Be.Auto.Hangfire.Dashboard.RecurringJobManager 1.2.6

There is a newer version of this package available.
See the version list below for details.
dotnet add package Be.Auto.Hangfire.Dashboard.RecurringJobManager --version 1.2.6
                    
NuGet\Install-Package Be.Auto.Hangfire.Dashboard.RecurringJobManager -Version 1.2.6
                    
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="Be.Auto.Hangfire.Dashboard.RecurringJobManager" Version="1.2.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Be.Auto.Hangfire.Dashboard.RecurringJobManager" Version="1.2.6" />
                    
Directory.Packages.props
<PackageReference Include="Be.Auto.Hangfire.Dashboard.RecurringJobManager" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Be.Auto.Hangfire.Dashboard.RecurringJobManager --version 1.2.6
                    
#r "nuget: Be.Auto.Hangfire.Dashboard.RecurringJobManager, 1.2.6"
                    
#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.
#:package Be.Auto.Hangfire.Dashboard.RecurringJobManager@1.2.6
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Be.Auto.Hangfire.Dashboard.RecurringJobManager&version=1.2.6
                    
Install as a Cake Addin
#tool nuget:?package=Be.Auto.Hangfire.Dashboard.RecurringJobManager&version=1.2.6
                    
Install as a Cake Tool

Be.Auto.Hangfire.Dashboard.RecurringJobManager

Overview

Be.Auto.Hangfire.Dashboard.RecurringJobManager is a specialized library for managing recurring jobs in Hangfire-based projects. It allows you to configure and manage various types of jobs, including method calls and web requests, directly from the Hangfire Dashboard. This enables all job management tasks to be handled through the dashboard interface without needing to manually add jobs in code.

Version 1.2.1 Highlights

  • Bug Fixes: Known issues in previous versions have been resolved.
  • Prevent Concurrent Execution Improvements: Concurrent execution prevention has been improved on a per-job basis.
  • Web Request Jobs API: Fire-and-forget WebRequestJobs can now be added externally via a dedicated API.
  • HangfireWebRequestJobApiClient: A new client class added for easier programmatic submission of WebRequestJobs.
  • Application-Wide Improvements: General performance and usability improvements across the system.

Key Features

  • Automatic Type and Method Detection: Automatically detects types and methods within the project’s assembly, allowing you to input parameters directly through the Hangfire Dashboard.
  • Dependency Injection (DI) Support: Types registered with DI are automatically resolved.
  • Comprehensive Job Management: Supports MethodCall and WebRequestJob types, with full control over job creation, editing, and deletion through the dashboard.
  • HTTP Request Jobs: Allows detailed configuration of HTTP requests, including headers, body, and query parameters, directly through the dashboard. It also prevents collisions by avoiding the duplication of jobs with identical parameters.
  • Fire-and-Forget API: External systems can enqueue WebRequest jobs directly as fire-and-forget tasks via the new API endpoint.
  • Client Support: Provides a convenient HangfireWebRequestJobApiClient to simplify adding WebRequestJobs programmatically.

Installation

  1. Add the NuGet Package:
Install-Package Be.Auto.Hangfire.Dashboard.RecurringJobManager
  1. Configure Services: In your Startup.cs, add the following configuration:
public void ConfigureServices(IServiceCollection services)
{
    services.AddHangfire(config => config
        .UseSqlServerStorage(Configuration.GetConnectionString("HangfireConnection"))
        .UseDashboardRecurringJobManager(option =>
        {
            option.AddAppDomain(AppDomain.CurrentDomain);
            option.DisableConcurrentlyJobExecution();
            option.WebRequestJobTimeout(TimeSpan.FromSeconds(15));
        }));

    services.AddHangfireServer();
}

Usage

Dashboard Usage

  1. Run the Example Project: Start the project and navigate to http://localhost:<port>/hangfire to access the Hangfire Dashboard.

  2. Add a New Job: Go to the Recurring Job Manager section in the dashboard. Add a new job, selecting either the MethodCall or WebRequestJob type. Enter the necessary parameters, such as HTTP headers, body, and query parameters, directly through the dashboard interface.

  3. Manage Jobs: View, edit, delete, pause, or restart the jobs from the dashboard as needed.

  4. Fire-and-Forget Jobs via API: WebRequestJobs can now be added externally as fire-and-forget jobs via the provided API endpoint /api/web-request-job.

  5. Automatic Resolution: Methods and types within the project are automatically detected, allowing you to configure their parameters directly via the Hangfire Dashboard.

Client Usage (Programmatic)

To simplify adding web request jobs programmatically, use the HangfireWebRequestJobApiClient:

// Instantiate client
var client = new HangfireWebRequestJobApiClient(new Uri("https://your-api-host.com"));
client.Headers.Add(new HttpHeaderParameter { Name = "Authorization", Value = "Bearer <token>" });
JSON Body Example
var jobJson = new WebRequestJobBodyJson
{
    Uri = new Uri("https://api.example.com/v1/customers"),
    Method = HttpMethodType.POST,
    HeaderParameters = new []
    {
        new HttpHeaderParameter { Name = "Content-Type", Value = "application/json" }
    },
    BodyParameters = new { name = "Jane Doe", email = "jane@example.com" }
};

var response = await client.AddAsync(jobJson);
Console.WriteLine(response.StatusCode);
XML Body Example
var xmlDoc = new XmlDocument();
xmlDoc.LoadXml("<Customer><Name>Jane</Name><Email>jane@example.com</Email></Customer>");

var jobXml = new WebRequestJobBodyXml
{
    Uri = new Uri("https://api.example.com/v1/customers"),
    Method = HttpMethodType.POST,
    HeaderParameters = new []
    {
        new HttpHeaderParameter { Name = "Content-Type", Value = "application/xml" }
    },
    BodyParameters = xmlDoc
};

var response = await client.AddAsync(jobXml);
FormUrlEncoded Example
var jobFormUrl = new WebRequestJobBodyFormUrlEncoded
{
    Uri = new Uri("https://api.example.com/v1/login"),
    Method = HttpMethodType.POST,
    HeaderParameters = new []
    {
        new HttpHeaderParameter { Name = "Content-Type", Value = "application/x-www-form-urlencoded" }
    },
    BodyParameters = new[]
    {
        new HttpFormUrlEncodedParameter { Name = "username", Value = "jane" },
        new HttpFormUrlEncodedParameter { Name = "password", Value = "123456" }
    }
};

var response = await client.AddAsync(jobFormUrl);
FormData Example
var jobFormData = new WebRequestJobBodyFormData
{
    Uri = new Uri("https://api.example.com/v1/upload"),
    Method = HttpMethodType.POST,
    HeaderParameters = new []
    {
        new HttpHeaderParameter { Name = "Authorization", Value = "Bearer <token>" }
    },
    BodyParameters = new[]
    {
        new HttpFormDataParameter { Name = "username", Value = "burak.eser", ContentType = "text/plain" },
        new HttpFormDataParameter { Name = "profilePicture", Value = "BASE64_STRING_HERE", ContentType = "image/png" }
    }
};

var response = await client.AddAsync(jobFormData);
PlainText Body Example
var jobText = new WebRequestJobBodyPlainText
{
    Uri = new Uri("https://api.example.com/v1/notes"),
    Method = HttpMethodType.POST,
    HeaderParameters = new []
    {
        new HttpHeaderParameter { Name = "Content-Type", Value = "text/plain" }
    },
    BodyParameters = "This is a plain text note."
};

var response = await client.AddAsync(jobText);
None Body Example
var jobNone = new WebRequestJobBodyNone
{
    Uri = new Uri("https://api.example.com/v1/ping"),
    Method = HttpMethodType.GET,
    HeaderParameters = new []
    {
        new HttpHeaderParameter { Name = "Authorization", Value = "Bearer <token>" }
    }
};

var response = await client.AddAsync(jobNone);

All responses are returned as WebRequestJobResponse, containing StatusCode, ExceptionCode, and ExceptionMessage.

Contributing

To contribute, fork this repository, make your changes, and submit a pull request. For any issues or feedback, please open an issue on GitHub.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 is compatible.  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.  net9.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 is compatible.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.7 213 8/28/2025
1.2.6 195 8/27/2025
1.2.5 113 8/22/2025
1.2.4 148 8/20/2025
1.2.3 119 8/17/2025
1.2.1 117 8/17/2025
1.2.0 76 8/16/2025
1.1.3 102 8/15/2025
1.1.2 1,029 5/9/2025
1.1.1 1,652 2/12/2025
1.1.0 210 2/10/2025
1.0.9 106,535 11/15/2024
1.0.8 129 11/14/2024
1.0.7 134 11/14/2024
1.0.6 136 11/14/2024
1.0.5 142 11/12/2024
1.0.4 139 10/24/2024
1.0.3 128 10/23/2024
1.0.2 150 9/2/2024
1.0.1 138 8/27/2024
1.0.0 166 8/26/2024