mrjamiebowman.Hangfire.JobManagement
9.0.8
dotnet add package mrjamiebowman.Hangfire.JobManagement --version 9.0.8
NuGet\Install-Package mrjamiebowman.Hangfire.JobManagement -Version 9.0.8
<PackageReference Include="mrjamiebowman.Hangfire.JobManagement" Version="9.0.8" />
<PackageVersion Include="mrjamiebowman.Hangfire.JobManagement" Version="9.0.8" />
<PackageReference Include="mrjamiebowman.Hangfire.JobManagement" />
paket add mrjamiebowman.Hangfire.JobManagement --version 9.0.8
#r "nuget: mrjamiebowman.Hangfire.JobManagement, 9.0.8"
#:package mrjamiebowman.Hangfire.JobManagement@9.0.8
#addin nuget:?package=mrjamiebowman.Hangfire.JobManagement&version=9.0.8
#tool nuget:?package=mrjamiebowman.Hangfire.JobManagement&version=9.0.8
mrjamiebowman.Hangfire.JobManagement (.NET 8)
NOTE: This is a fork that's going a different direction. Just getting started... Below will be updated. - 05/27/2024 @mrjamiebowman
A robust extension to .NET Hangfire that adds a Job Management Dashboard, Notifications, and Settings.
Features (Coming Soon!)
- Dashboard
- Start / Stops Jobs
- Edit Jobs
- Job Notifications (Web Hooks, Message Queues, Emails)
- Search Capabilities
- Batch Jobs
- Job History
- Settings
Requirements
- MSSQL Server
- .NET 8
Dockerized & Ready for Kubernetes (Helm Charts)
// TODO: Share GitHub Sample.
Instructions
Install a package from NuGet.
Install-Package Hangfire.JobManagement
Then add this in your code:
For .NET
for service side:
// job management
builder.Services.ConfigureJobManagement(builder.Configuration);
// hangfire
services.AddHangfire(h => h.UseSqlServerStorage(Configuration.GetConnectionString("HangfireConnection"))
/* job management */
.UseJobManagement(jobManagementConfig, b => {
// assemblies
b.ConfigureAssemblies(new Assembly[] {
typeof(Program).Assembly
});
// database
b.ConfigureDatabase();
// features
b.ConfigureFeatures(f => {
f.Notifications = true;
f.Settings = true;
});
})
Controller Job Management
Typically, I use a controller to rapidly set up (Add or Update) or remove all of the jobs rapidly. This is useful for deploying to multiple environments.
app.MapGet("/setup/jobs", () =>
{
var recurringJobOptions = new RecurringJobOptions();
// jobs
RecurringJob.AddOrUpdate<IJobLogCleanUp>("LogCleanup", job => job.ExecuteAsync(null, null, CancellationToken.None), Cron.Daily);
RecurringJob.AddOrUpdate<IJobReports>("Reports", job => job.ExecuteAsync(null, null, CancellationToken.None), Cron.Daily);
return "OK";
})
.WithName("JobSetup")
//.RequireAuthorization()
.WithOpenApi();
app.MapGet("/setup/remove", () =>
{
// remove if exists...
RecurringJob.RemoveIfExists("LogCleanup");
RecurringJob.RemoveIfExists("Reports");
return "OK";
})
.WithName("JobRemoval")
//.RequireAuthorization()
.WithOpenApi();
app.MapGet("/up", () => {
return "UP";
})
.WithName("up")
.WithOpenApi();
EntityFramework Core
# install tool
dotnet tool install --global dotnet-ef
# migrations
dotnet ef migrations add -v -p ./src/Hangfire.JobManagement/Hangfire.JobManagement.csproj -c JobManagementDbContext -s ../../src/MrJB.Hangfire/ -o ./src/Hangfire.JobManagement/Data/Migrations initial
Credits
This project was inspired by other Hangfire projects and forked from Brayan Mota's RecurringJobAdmin.
- Braulio Alvarez - original developer of Hangfire.RecurringJobAdmin
- Brayan Mota (bamotav) - forked his project.
License
This project is under MIT license. You can obtain the license copy here.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net8.0
- Cronos (>= 0.11.1)
- Hangfire.Core (>= 1.8.21)
- Humanizer (>= 2.14.1)
- Microsoft.EntityFrameworkCore (>= 9.0.8)
- Microsoft.EntityFrameworkCore.Abstractions (>= 9.0.8)
- Microsoft.EntityFrameworkCore.Relational (>= 9.0.8)
- Microsoft.EntityFrameworkCore.SqlServer (>= 9.0.8)
- Microsoft.Extensions.Configuration (>= 9.0.8)
- Microsoft.Extensions.Configuration.Binder (>= 9.0.8)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 9.0.8)
- Microsoft.Extensions.Configuration.Json (>= 9.0.8)
- Microsoft.Extensions.Logging (>= 9.0.8)
- mrjamiebowman.Hangfire.JobManagement.Abstractions (>= 1.0.0)
- OpenTelemetry (>= 1.12.0)
- System.Text.Json (>= 9.0.8)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.