Open Closed

Override default values for a specific background job #8792


User avatar
0
stephanobalbinot created
  • ABP Framework version: v8.3.4
  • UI Type: Angular
  • Database System: EF Core (PostgreSQL)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

Currently I'm using the default background job manager and have this configuration for background jobs in my application.

But there's a specific background job that I do not want to retry in case of failure. How can I override default values just for this job?

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

1 Answer(s)
  • User Avatar
    1
    berkansasmaz created
    Support Team .NET Developer

    You can't set different retry count for each job with DefaultBackgroundJobManager. If you want a custom implementation, you can replace DefaultBackgroundJobManager with your CustomBackgroundJobManager. So it's open-source: https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.BackgroundJobs/Volo/Abp/BackgroundJobs/DefaultBackgroundJobManager.cs

    [Dependency(ReplaceServices = true)]
    public class CustomBackgroundJobManager : DefaultBackgroundJobManager
    {
        public CustomBackgroundJobManager(IClock clock, IBackgroundJobSerializer serializer, IBackgroundJobStore store, IGuidGenerator guidGenerator) : base(clock, serializer, store, guidGenerator)
        {
        }
    
        protected override Task<Guid> EnqueueAsync(string jobName, object args, BackgroundJobPriority priority = BackgroundJobPriority.Normal, TimeSpan? delay = null)
        {
            // Custom implementation
            throw new NotImplementedException();
        }
    }
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 28, 2026, 11:44
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.