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