CrnaStena
CrnaStena

Reputation: 3167

Azure Service Fabric and Scheduled Tasks

Say you have 30+ console applications running on the Windows machine which can invoked manually or through Windows Scheduled Tasks, what would be recommended way to move to/implement them in Service Fabric?

One way of implementing this would be as one Service Fabric application with many stateless services (Reliable Actor using Timers/Reminders) each listening to the Service Bus queue/topic, and then use Azure Scheduler to send messages to the queue/topic.

What would be the pros/cons of such implementation? This article seems to list few of them.

What would be other ways to implement this?

Seems like some people are trying to advocate for including pub/sub framework into Service Fabric, if that becomes part of Service Fabric would that a valid option?

Upvotes: 4

Views: 4128

Answers (2)

Bryan Cox
Bryan Cox

Reputation: 298

I like your idea of converting the console applications to actors and using reminders. However, I don't see the need for Service Bus or the Azure Scheduler.

It seems to me that you only need to expose a few API methods on the actors. One to create/modify the run schedule, and a second that would allow the actor to be manually/immediately invoked (while still maintaining turn-based concurrency). The actor could store its full schedule internally, but it only only ever needs to calculate the next time to execute - and set the reminder accordingly.

Also, keep in mind that actor reminders are triggered under all circumstances, whereas a timer stopped if Service Fabric deactivates the actor.

Upvotes: 3

jimpaine
jimpaine

Reputation: 887

I would look at using Azure Functions, this would be great for simplicity and trendy being Serverless compute, meaning no need to spin up and configure a bus or queue, then use Stateless reliable API services and have the Azure timed Function call the stateless service directly.

See here for a start:

https://azure.microsoft.com/en-us/services/functions/

This Video is doing a timer with db clean up by no reason why this couldn't be a HTTP call.

Video

Upvotes: 3

Related Questions