Using JDBC store instead of RAMStore
jitengupta opened this issue · 4 comments
Hi,
Is there a way I can configure akka-quartz-scheduler to use JDBC store instead of RAMStore. Where can i specify JDBC data source details ?
We don't currently support reading schedules via JDBC. However, you can dynamically add / remove schedule entries at runtime. For your use case, I would suggest writing a simple actor within your application which polls the database on startup (and then again periodically for changes) and sends those schedules to the scheduler to have them dynamically added / removed at runtime.
Does that make sense?
Thanks for quick reply. I had a similar idea, but then quartz does support JDBC stores and cluster aware capabilities via JDBC store. Its an cluster aware feature that I was looking for. Any pointers on how can we change the code to configure JDBC store instead of RAM store. I would be apply to fork and add this feature.
Most of the changes would take place in QuartzSchedulerExtension
. Basically, you would update the creation of jobStore
to read from the akka.quartz
section of the config file. If there's a jobStore specified and the value is JDBC
then you would read in the JDBC connection parameters and build the JDBC Quartz job store accordingly. If the jobStore
value is either not-specified or is RAM
, then you would default to the RAMJobStore
. Anything else would cause an IllegalArgumentException
to be thrown.
Feel free to build this out and be sure to update the docs and include test cases.
Marking this as closed due to lack of activity. Please reopen if you have a PR for review