This repository is aimed to hold Azure Service Fabric related samples.
Azure Service Fabric Servies can be configured to exhibit trigger based bahvior similar to WebJobs and Azure Functions. Have added a code samples to exhibit such behavior (Detailed below).
To create a time triggered (scheduler) Service in Azure Service Fabric, I can think of following two quick options among the possible ways.
- Create a time triggered WebJob and add/deploy it as a guest executable in Azure Service Fabric.
- Create Azure Service Fabric Stateless Service and implement the listener to handle jobs.
Here I'm taking the second approach which involves the respective listener to be created. Rather than writing new Scheduling framework, I'm using the Quartz.Net framework. I'm using the CRON expression behavior to have the behavior inline with the time trigger behavior of WebJobs and Azure Functions.
- Solution: ServiceFabricTriggerSolution
- Projects:
- Uses Quartz.Net framework.
- Without Dependency Injection.
- Listerner gets all the
IJob
types from the current assembly withJobInfoAttribute
decorated. JobInfoAttribute
holds the name and CRON expression of the job.
- Uses Quartz.Net framework.
- With Dependency Injection using Autofac (Autofac integration package for Quartz.Net).
- Listerner gets all the
IJob
types from the current assembly withJobInfoAttribute
decorated. JobInfoAttribute
holds the name and CRON expression of the job.