We have microservices running inside Azure Service fabric and we have a background task that needs to run once every 15 minutes to do some DB related operations. I see 2 options.
Use the StatelessService.RunAsync method and implement the background task under one of the relavant microservices.
Implement the logic using HostedService and do services.AddHostedService inside ConfigureServices method in startup.cs of the relevant microservice.
What's the difference and which way would be preferred?
Thanks
Options:
Have a look at this blog for reliable actors with reminders
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.