Open Closed

Background Jobs with multi tentant #1635


User avatar
0
BernardoTeixeira created
  • ABP Framework version: v4.3.3
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes

Hi, I want to use the background service with hangfire and multi tenant. Do you have any example for this? Or any type of documentation for this type of example?

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

14 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi @BernardoTeixeira

    Can you explain your use case?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    See: https://support.abp.io/QA/Questions/1628/AsyncBackgroundJobs#answer-9bd678d0-8939-94ff-3d01-39fdfeea6986

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    BernardoTeixeira created

    hi @BernardoTeixeira

    Can you explain your use case?

    I want to know the best approach to use Hangfire with multi tenant. Because I want to isolate all the backgrounds services, a solution just for background services.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    There is currently no such best practice, depending on your use case.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    BernardoTeixeira created

    I'm having some problems register background jobs. I follow this -> https://docs.abp.io/en/abp/latest/Background-Jobs and also this -> https://docs.abp.io/en/abp/latest/Background-Jobs-Hangfire

    But in the hangfire dashboard I dont have the job.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you share a simple project with me? liming.ma@volosoft.com

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    BernardoTeixeira created

    I sent you an invitation for github

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi BernardoTeixeira

    Please share the steps? btw, Why are you using module templates?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    BernardoTeixeira created

    hi BernardoTeixeira

    Please share the steps? btw, Why are you using module templates?

    My steps was https://docs.abp.io/en/abp/latest/Background-Jobs and also this -> https://docs.abp.io/en/abp/latest/Background-Jobs-Hangfire, I just want register background services and make recurring job.

    Because I want to isolate the Background services.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    BernardoTeixeira created

    If I understand correctly, the Identity server have the tenants and also the connections strings. I can expose the data for the tenant's Id(using an endpoint) and then use CurrentTenant.Change so I can have the connections string for that tenant.

    But in that case, my Background Module will connect directly to the database. I don't want that. Instead, I want to connect my background service to an API. Is this approach supportable with CurrentTenant.Change or the ABP has another approach?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    It works for me.

    I want to connect my background service to an API. Is this approach supportable with CurrentTenant.Change or the ABP has another approach?

    Your API may require permissions, and authentication in a background job is not recommended. This is complicated.

    You can consider calling the domain service directly in the job, so that CurrentTenant.Change will work.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    BernardoTeixeira created

    It doenst work for me... Did you change anything?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    I didn't change anything. : )

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    ServiceBot created
    Support Team Automatic process manager

    This question has been automatically marked as stale because it has not had recent activity.

    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 16, 2026, 14:50
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.