Open Closed

Hangfire Integration #9662


User avatar
0
alex.maiereanu@3sstudio.com created

Hi ABP team,

I have a question regarding HangfirePeriodicBackgroundWorkerAdapter. I understand this is a worker which is asking as a bridge. What I don't find so nice about this approach is that it's flooding the hangfire dashboard, and if somebody wants to check jobs of the application it's difficult to find them.

If someone would use directly HangfireBackgroundWorkerBase , would HangfirePeriodicBackgroundWorkerAdapter actually be necessary? And if no, can it be disabled?


8 Answer(s)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    • If you use HangfireBackgroundWorkerBase directly, you do not need the HangfirePeriodicBackgroundWorkerAdapter. The adapter is only necessary when you want to run ABP's IBackgroundWorker implementations (such as AsyncPeriodicBackgroundWorkerBase) on Hangfire, bridging ABP's background worker system to Hangfire's infrastructure.

    • When you implement your workers by inheriting from HangfireBackgroundWorkerBase, you are using Hangfire's native recurring job mechanism, and jobs will appear in the dashboard as you define them, without the adapter's extra entries.

    • To avoid flooding the Hangfire dashboard with HangfirePeriodicBackgroundWorkerAdapter jobs, you can disable or remove the registration of ABP's background workers that use the adapter, and instead implement your recurring jobs directly using HangfireBackgroundWorkerBase.

    • In summary: HangfirePeriodicBackgroundWorkerAdapter is not required if you use HangfireBackgroundWorkerBase. You can disable the adapter by not registering ABP background workers that rely on it.

    Sources:

    • https://abp.io/docs/latest/framework/infrastructure/background-workers/hangfire

    This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can set the job name after 9.3.0

    https://github.com/abpframework/abp/issues/22700 https://github.com/abpframework/abp/pull/22714

    Thanks.

  • User Avatar
    0
    alex.maiereanu@3sstudio.com created

    Hi Maliming,

    I don't want to set a new name, I want to get rid of HangfirePeriodicBackgroundWorkerAdapter from the hangfire dashboard because it's generating a flood of executed jobs, which eat up the ones that we care about.

    Is it actually necessary to run HangfirePeriodicBackgroundWorkerAdapter if we use only HangfireBackgroundWorkerBase

  • User Avatar
    0
    Frontis2 created

    Alex, this might help?:

    https://github.com/face-it/Hangfire.Tags

  • User Avatar
    0
    alex.maiereanu@3sstudio.com created

    Hi Frontis,

    Thanks for doing the research. The repository seems out of date and I wouldn't base a solution on this.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    ABP hangfire module will use HangfirePeriodicBackgroundWorkerAdapter to execute your/modules PeriodicBackgroundWorkers.

    Maybe we can remove HangfirePeriodicBackgroundWorkerAdapter and execute the worker directly. I will check this.

    However, all workers are still listed in the Hangfire dashboard.

    Thanks.

  • User Avatar
    0
    alex.maiereanu@3sstudio.com created

    Yeah, it's clear that we are going to see internal abp workers, but right now I think that Activate<HangfirePeriodicBackgroundWorkerAdapter<BackgroundJobWorker>>() is not doing anything, since we don't have internally any PeriodicBackgroundWorkers , we always use HangfirePeriodicBackgroundWorkerAdapter

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    The built-in modules(OpenIddict, Identity.Pro...) will have some PeriodicBackgroundWorkers.

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.0.0-preview. Updated on September 01, 2025, 08:37