We are leaving Russia. We are against aggression and war with Ukraine. It is a tragedy for our nations, it is a nightmare

Hangfire 1.8.0-beta2 and beta1 recently released. The new versions bring a lot of improvements to create more complex workflows with new continuation options, improve role of the DeletedState that now has its own exception information and displayed on graphs when supported by an underlying storage, bring more methods for underlying abstractions to reduce the number of round-trips to a storage and other features as well. Also this version has better defaults for Hangfire.SqlServer package, and sliding invisibility timeout option will now be used by default.

Please note this is a pre-release version so it should be used only in development and staging environments. The final release should be available in Sep/Oct 2021 after adding a ton of unit and integration tests. Upgrade notes will only be available slightly before the final release is made, however breaking changes are avoided at all costs – just don’t use the new features before upgrading the whole environment to the latest version.

Release Notes

Hangfire.Core

  • Added – Display deleted jobs in the Realtime and History graphs when supported by storage.
  • AddedDeletedState now have the persisted Exception property.
  • AddedJobContinuationOptions.OnlyOnDeletedState to create continuations after a failure.
  • AddedException job parameter is passed to continuation when UseResultsInContinuations method is used.
  • AddedFromExceptionAttribute to deal with an antecedent exception in a background job continuation.
  • Added – Allow to filter exception types in AutomaticRetryAttribute by using the new OnlyOn property.
  • AddedIBackgroundProcess.UseBackgroundPool now allows to pass thread configuration logic.
  • AddedIGlobalConfiguration.UseJobDetailsRenderer method for custom renderers.
  • AddedBackgroundJobServerOptions.WorkerThreadConfigurationAction option
  • Added – Allow to pass custom data to ApplyStateContext and ElectStateContext instances.
  • Added – Preserve custom data dictionary between the entire filter chain.
  • AddedIGlobalConfiguration.UseDashboardMetrics extension method to pass multiple metrics at once.
  • Added – State renderer for the DeletedState to display its new exception property.
  • Added – Virtual JobStorage.GetReadOnlyConnection method intended to return JobStorageConnection for replicas.
  • Added – Virtual JobStorage.HasFeature method for querying optional features.
  • Added – Optional GetSetCount and GetUtcDateTime methods for the JobStorageConnection class.
  • Added – Optional AcquireDistributedLock and RemoveFromQueue methods for the JobStorageTransaction class.
  • Added – Support for transactional acknowledge using new storage method for better handling some data loss scenarios.
  • AddedFactory, StateMachine and Performer properties to context classes to avoid injecting services.
  • Added – Allow to pass transaction to background job state changer when new methods implemented.
  • Added – Optional ParametersSnapshot property for BackgroundJob and JobData classes to minimize roundtrips in future.
  • AddedMisfireHandlingMode.Strict to create job for each missed recurring job occurrence.
  • Added – Allow to pass parameters when creating a job (by @brian-knoll-micronetonline).
  • Added – Make it possible to use multiple JobContinuationOptions for a continuation.
  • AddedCreateJob method to the JobStorageTransaction abstract class.
  • AddedSetJobParameter method to the JobStorageTransaction abstract class.
  • Changed – Use the AttemptsExceededAction.Delete option by default in the global automatic retry filter.
  • Changed – Move job to the DeletedState instead of SucceededState when its invocation was canceled by a filter.
  • ChangedFromParameterAttribute-based logic now always overwrites arguments, even with non-null values.
  • Changed – Improved display of real-time chart with more accents on failed and deleted jobs.
  • Changed – Ignore some members when serializing a JobFilterAttribute instance to decrease size
  • ChangedServerHeartbeatProcess now uses ThreadPriority.AboveNormal to prioritize heartbeats.
  • Changed – Allow to query job parameters without roundtrip when supported by a storage.
  • Changed – Turn JobContinuationOptions enum into flags while still possible.
  • Changed – Fetch “Retries” metric with other statistics when supported by storage.
  • Changed – Avoid storage roundtrip to query job data in worker, take data from previous state change.
  • Changed – Don’t overwrite existing argument values with null job parameters when using FromParameter attribute.

Hangfire.SqlServer

  • Added – Recommended Schema 8 migration with fixed JobQueue.Id column to use bigint type.
  • AddedSqlServerStorageOptions.PreferMicrosoftDataSqlClient option to use the corresponding package.
  • AddedSqlServerStorage.SchemaVersion metric for Dashboard UI.
  • Added – Implement optional experimental transactional acknowledge for SQL Server (UseTransactionalAcknowledge option).
  • Changed – Sliding invisibility timeout-based fetching method is now used by default with 5 minute timeout.
  • Changed – Set default value for the QueuePollInterval option to TimeSpan.Zero.
  • Changed – Use command batching by default with 5-minute maximum timeout.
  • Changed – Enable UseRecommendedIsolationLevel option by default.

Hangfire.NetCore and Hangfire.AspNetCore

  • AddedIApplicationBuilder.UseHangfireServer that accepts custom factory for IBackgroundProcessingServer.

Subscribe to monthly updates

Subscribe to receive monthly blog updates. Very low traffic, you are able to unsubscribe at any time.

Comments