Kiril1512
Kiril1512

Reputation: 3611

Access to the scheduled jobs in Quartz when on many instances

Imagine I have a microservices to schedule a reminder. It will be scaled to 3 instances of that microservice and more if need. They share 2 endpoints -> POST(SheduleReminder) and POST(UpdateSheduleReminder)

The first request will be scheduled on instance A (Id = 1), the second on B (Id = 2) and the third on C (Id = 3). Imagine it working with load balancer.

Now if I want update the job with Id = 2, how I can pick/know on what instance of my microservice is the job scheduled in memory?

Is this a problem and I need to manage somehow in what instance is the job running?

Thank you!

Upvotes: 1

Views: 1155

Answers (1)

user06062019
user06062019

Reputation: 691

Moving comments to Answer.

1 Through RAMJobStore which is volatile it is not possible to achieve clustering of quartz instances as they store data local to the instance where quartz scheduler is running.In case of instance failure the job data/details will be lost.

2 To enable clustering of quartz instances,JDBCStore or .NET equivalent of it should be used.This JobStore persist the data in the database.As long as all the instances of quartz are sharing the same database clustering is possible.

Refer to these links Quartz Clustering documentation for .NET

Important Clustering Setting

Upvotes: 2

Related Questions