An easy way to perform background job processing in .NET and .NET Core applications. No Windows Service or separate process required
Hangfire.Core
MaxLinesInStackTrace
for a particular FailedState
instance.DisableConcurrentExecutionAttribute
and LatencyTimeoutAttribute
serializable.Hangfire.Core
Hangfire.SqlServer
InvalidOperationException
with new dashboard metrics when a database has multiple data/log files.Hangfire.Core
MisfireHandlingMode.Ignorable
to avoid scheduling recurring jobs on missed schedules.DashboardOptions.DarkModeEnabled
property.WithJobExpirationTimeout
configuration method.UseDefaultCulture
configuration method overloads.UseDashboardStylesheet
and UseJobDetailsRenderer
configuration methods.state-card-state-active
color is not very dark (by @coolhome).Hangfire.SqlServer
forceseek
table hint whenever possible to avoid performance drops.Hangfire.NetCore
net461
target for Hangfire.NetCore package to avoid missing method exceptions.Please see more human-friendly release notes in our blog https://www.hangfire.io/blog/2023/04/28/hangfire-1.8.0.html. Please see https://docs.hangfire.io/en/latest/upgrade-guides/upgrading-to-hangfire-1.8.html to learn how to upgrade.
Hangfire.Core
NET45
platform target in favor of the NET451
target to support Visual Studio 2022.Job.Queue
property, so jobs now can have their own queue specified.IBackgroundJobClient.Create
method overloads with the new queue
parameter.AutomaticRetryAttribute
by using the new OnlyOn
property.DeletedState
now has the persisted Exception
property populated after a failure.JobContinuationOptions.OnlyOnDeletedState
to create continuations after a failure.Exception
job parameter is passed to continuation when UseResultsInContinuations
method is used.FromExceptionAttribute
to deal with an antecedent exception in a background job continuation.JobContinuationOptions
values for a continuation.BackgroundJobServerOptions.IsLightweightServer
option to run a server with no storage processes.DisableConcurrentExecution
filter.ServerId
to FailedState
instances to simplify the debugging on different servers.MisfireHandlingMode.Strict
to create a job for each missed recurring job occurrence.UseDefaultCulture
configuration method.captureDefault
parameter in the CaptureCulture
filter.IGlobalConfiguration.UseFilterProvider
extension method to unify the configuration.Remove
method for JobFilterCollection
to remove global filters based on their type.CompatibilityLevel.Version_180
flag to avoid storing culture parameters when they are the same as the default ones.Transaction.CreateJob
feature is supported by the storage.DeletedState
instead of SucceededState
when its invocation was canceled by a filter.CurrentCulture
parameter when CurrentUICulture
one is missing.BackgroundJobServerOptions.StopTimeout
to 500 ms.AddOrUpdate
overloads with optional params defined in the RecurringJobManagerExtensions
class.AddOrUpdate
overloads with optional parameters defined in the RecurringJob
class.AddOrUpdate
method overloads with no recurringJobId
parameter.RecurringJobOptions.QueueName
property, new methods should be used instead.NET45
platform target in favor of NET451
target to support Visual Studio 2022.Dashboard UI
DashboardRoutes
class.DefaultRecordsPerPage
property on the DashboardOptions
class (by @PaulARoy).IGlobalConfiguration.UseJobDetailsRenderer
method for custom renderers for the Job Details page.IGlobalConfiguration.UseDashboardMetrics
extension method to pass multiple metrics at once.DeletedState
to display its new exception property.MonitoringApi
methods for the Awaiting Jobs page.default
one.Extensibility
Factory
, StateMachine
, and Performer
properties to context classes to avoid injecting services.ApplyStateContext
and ElectStateContext
instances.JobFilterAttribute
instance to decrease the payload size.Storage
JobStorage.GetReadOnlyConnection
method intended to return JobStorageConnection
for replicas.JobStorage.HasFeature
method for querying optional features.JobStorageFeatures
class to avoid using magic strings in storage features.GetSetCount
, GetSetContains
, and GetUtcDateTime
methods for the JobStorageConnection
class.AcquireDistributedLock
and RemoveFromQueue
methods for the JobStorageTransaction
class.CreateJob
and SetJobParameter
methods for the JobStorageTransaction
class.ParametersSnapshot
property for BackgroundJob
and JobData
classes to minimize roundtrips in the future.Retries
and Awaiting
metrics in StatisticsDto
properties when supported by storage.JobStorageMonitor
class with more available methods for the new features.Monitoring.AwaitingJobs
feature.Internals
IBackgroundProcess.UseBackgroundPool
now allows to pass thread configuration logic.BackgroundJobServerOptions.WorkerThreadConfigurationAction
option for custom thread configuration.FromParameterAttribute
-based logic now always overwrites arguments, even with non-null values.JobContinuationOptions
enum into flags while still possible.TaskExtensions.WaitOneAsync
only with the RegisterWaitForSingleObject
method.ServerHeartbeatProcess
now uses ThreadPriority.AboveNormal
to prioritize heartbeats.Hangfire.NetCore
IApplicationBuilder.UseHangfireServer
that accepts custom factory for IBackgroundProcessingServer
.net451
and netstandard1.3
targets for the package.netstandard2.1
target instead of netcoreapp3.0
for the package.ObjectDisposedException
when hosted service is disposed twice.Hangfire.AspNetCore
IApplicationBuilder.UseHangfireServer
that accepts custom factory for IBackgroundProcessingServer
.Hangfire.SqlServer
NET45
platform target in favor of the NET451
target to support Visual Studio 2022.Schema 8
migration with fixed JobQueue.Id
column to use the bigint
type.Schema 9
migration that creates an index for the State.CreatedAt
column.System.Data.SqlClient
(by @0xced).SqlServerStorageOptions.DbProviderFactory
option to use a custom provider factory.InactiveStateExpirationTimeout
is set.TryAutoDetectSchemaDependentOptions
option to automatically enable options based on the schema.UseTransactionalAcknowledge
option).Connection.GetUtcDateTime
feature to make work the new changes in schedulers.SqlServerStorage.SchemaVersion
metric for Dashboard UI.DefaultQueueProvider
option to specify a custom default queue provider.QueuePollInterval
option to TimeSpan.Zero
.QueuePollInterval
is set to zero now defaults to 200 ms.UseRecommendedIsolationLevel
option by default.GetJobData
now populates the JobData.ParametersSnapshot
property to avoid additional roundtrips.Transaction.AcquireDistributedLock
feature.GetSetCount.Limited feature
.GetSetContains feature
.Monitoring.AwaitingJobs
feature for SQL storage.UsePageLocksOnDequeue
option is now obsolete and doesn't affect anything.Hangfire.SqlServer.Msmq
NET45
platform target in favor of the NET451
target to support Visual Studio 2022.Hangfire.Core
DefaultRecordsPerPage
property on the DashboardOptions
class (by @PaulARoy).Hangfire.NetCore
ObjectDisposedException
when hosted service disposed twice.Hangfire.SqlServer
Schema 9
migration that creates index for the State.CreatedAt
column.InactiveStateExpirationTimeout
is set.DefaultQueueProvider
option to specify a custom default queue provider.Please see release notes in our blog – https://www.hangfire.io/blog/2023/03/30/hangfire-1.8.0-rc3.html.
captureDefault
parameter in the CaptureCulture
filter.StatisticsDto.Awaiting
for monitoring stats.JobStorageFeatures
class to avoid using magic strings in storage features.captureDefault
when dealing with default cultures instead of compatibility level.SetContains
to GetSetContains
for consistency.Monitoring.AwaitingJobs
feature.BatchedGetFirstByLowest
feature.NotSupportedException
from new storage methodsJobStorageMonitor
virtual, not abstract.Job.Queue
feature not supported.AttemptsExceededAction.Delete
option by default in the global automatic retry filter.Monitoring.AwaitingJobs
feature for SQL storage.Transaction.AcquireDistributedLock
feature.GetSetCount.Limited feature
.GetSetContains feature
.BackgroundJob
and IBackgroundJobClient
(by @chrischu).ArgumentNullException
with tricky generic type with inheritance case for jobs.MinPollingDelayMs
for SQL Server to 100 milliseconds.IAsyncDisposable
for IServiceScope
instances for newer .NET platforms.UseDefaultCulture
configuration method.CompatibilityLevel.Version_180
flag to avoid storing culture parameters when they are the same as default.BackgroundJobServerOptions.IsLightweightServer
option to run server with no storage processes.CurrentCulture
parameter when CurrentUICulture
one is missing.net451
and netstandard1.3
targets for the package.netstandard2.1
target instead of netcoreapp3.0
for the package.