Open Closed

Custom API with Background Job #751


User avatar
0
neurawitch created

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.

  • ABP Framework version: vX.X.X
  • UI type: Angular / MVC
  • DB provider: EF Core / MongoDB
  • Tiered (MVC) or Identity Server Seperated (Angular): yes / no
  • Exception message and stack trace:
  • Steps to reproduce the issue:

Any advice on the best way to implement a custom AP that's designed to handle callbacks from multiple external services anonomously that once the message is recived, needs to execute a background job that has to query/insert multiple records across several of the defined services within MongoDB? We have the callback working correctly, but having issues calling the db services, since the job is not running within the context of an authorized user. Is there a way where we can define a system user that has all the permissions necessary and if so, how would we go about setting that within the background job.

Apologies in advance if I missed this within the documentation.


1 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Your background job should call domain services instead of application services.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 10, 2024, 06:38