enragedginger / akka-quartz-scheduler

Quartz Extension and utilities for cron-style scheduling in Akka
Other
559 stars 115 forks source link

Is it difficult to make JobStore configurable? #85

Closed Unlocker closed 3 years ago

Unlocker commented 5 years ago

I am using a scheduler for the my web service based on Play Framework 2.5. I want to implement a possibility for a horizontal scaling. Several instances will create several independent JobStores and will execute jobs much frequent. Quartz has a clustered execution mode which provides by a corresponding common job store. Are there any ideas how to make this?

enragedginger commented 5 years ago

Initially, I would suggest staying with a single actor tied to the Quartz scheduler and have it simply forward the messages off to other pools of Akka actors as necessary.

You can find more information on setting up a proper Akka pool in the Akka documentation here: https://doc.akka.io/docs/akka/current/typed/routers.html#pool-router

enragedginger commented 5 years ago

Does that make sense?

Unlocker commented 5 years ago

@enragedginger, you are right with some proposals such as a single Akka cluster and a single actor which handles Quartz events and schedulers. I have another case because my Akka clusters are independent. There is a web app based on Play Framework. My production instance consists of two independent replicas of web application. I have enough when only one of replicas handles some Quartz event. I don't want to join two Akka clusters into a one but I suggest to use a clustered mode of Quartz based on a shareable job store. To place a job store I have two variants:

  1. Redis cache (https://github.com/RedisLabs/redis-quartz)
  2. MongoDB (https://github.com/michaelklishin/quartz-mongodb)

What do you think about?

felipebonezi commented 3 years ago

@enragedginger, you are right with some proposals such as a single Akka cluster and a single actor which handles Quartz events and schedulers. I have another case because my Akka clusters are independent. There is a web app based on Play Framework. My production instance consists of two independent replicas of web application. I have enough when only one of replicas handles some Quartz event. I don't want to join two Akka clusters into a one but I suggest to use a clustered mode of Quartz based on a shareable job store. To place a job store I have two variants:

  1. Redis cache (https://github.com/RedisLabs/redis-quartz)
  2. MongoDB (https://github.com/michaelklishin/quartz-mongodb)

What do you think about?

Is this make any sense yet?

BTW, both are valid. You need to answer is how do you to maintain it... With a Document database or an structured in memory database. I would prefer using Redis...

If you think that dont need answer anymore, lets close this issue @enragedginger

enragedginger commented 3 years ago

Closing for now. Feel free to re-open if you'd like to submit some kind of feature PR