Open datnguyenzzz opened 2 years ago
Must be provided env:
CronJob file format:
jobList:
- name: "Upload to SQS #1"
cronTrigger: "0 0 0 1 2 2/3"
usedService: "SQS"
messages:
- key: "key-1"
value: "value-1"
- key: "key-2"
value: "value-2"
- name: "Upload to SQS #2"
usedService: "SQS"
afterJobDone: "Upload to SQS #1"
lambdaActionFile: "abc/def/xyz.java"
- name: "Upload to SQS #3"
cronTrigger: "0 12 2 1 2/3 * *"
usedService: "SQS"
lambdaActionFile: "xyz/ghi/dfc.java"
CronJob Factory contain
Start quartz scheduler
JobFactory.newJob: Called by the scheduler at the time of the trigger firing, in order to produce a Job instance on which to call execute.
AWSPublisherFactory - define with method publisher will be used (SQS, Kinesis, Custom)
PublishingJob implement Job
[x] autowired AWSPublisher
[x] Because PublishJob is Bean -> need get instance of Bean in when sheduler call executer
[x] Pass usedService paramenter into Job description, in order to get corresponding Bean ....AWSPublisher
[x] Disallow concurrent functionality of PublishingJob (Example, if job is trigger every 5s, but a job need 10s to complete)
[ ] Handle misfired job
[x] Persist number of job executed in data map
[ ] REST API for adding new job
PublishigTrigger
Health check service: - quartz schedule health check job base periodically
AWS SDK using
Consist of 2 main component
Scheduler
Understand job definition from ENV variables
Implementation of Quartz (library for scheduling)
AWS SDK