java

nick 2020-09-05T20:21:05.014400Z

First time trying to use Quartz (via https://github.com/michaelklishin/quartzite ) in persistent(PostgreSQL/JDBC) mode.

(mount/defstate scheduler
  :start (let [s   (-> (qs/initialize) qs/start)
               job1 (j/build
                    (j/of-type OutboundSettlementCheckJob)
                    (j/with-identity (j/key "jobs.outbound-settlement-check-job.1")))
               trigger1 (t/build
                        (t/with-identity (t/key "triggers.1"))
                        (t/start-now)
                        (t/with-schedule (schedule
                                          (with-interval-in-seconds 60))))]
           (qs/schedule s job1 trigger1)
           s)
  :stop (qs/shutdown scheduler))
Steps that I followed: 1. created a new psql db(specified in quartz.properties), pasted initial schema https://github.com/quartz-scheduler/quartz/blob/quartz-2.1.x/docs/dbTables/tables_postgres.sql It must be a compatible version because latest quartzite is 2.1.0 2. After first (mount/start) everything works great. 3. (mount/stop) seems to properly shut down the quartzite scheduler accordingly to logs:
2020-09-05 23:04:32,433 [nREPL-session-9c9fbc57-deda-45d2-a253-f666dcd61d84] INFO  org.quartz.core.QuartzScheduler - Scheduler TestScheduler_$_NON_CLUSTERED shutting down. 
2020-09-05 23:04:32,433 [nREPL-session-9c9fbc57-deda-45d2-a253-f666dcd61d84] INFO  org.quartz.core.QuartzScheduler - Scheduler TestScheduler_$_NON_CLUSTERED paused. 
2020-09-05 23:04:32,433 [nREPL-session-9c9fbc57-deda-45d2-a253-f666dcd61d84] DEBUG org.quartz.simpl.SimpleThreadPool - Shutting down threadpool... 
2020-09-05 23:04:32,434 [nREPL-session-9c9fbc57-deda-45d2-a253-f666dcd61d84] DEBUG org.quartz.simpl.SimpleThreadPool - Shutdown of threadpool complete. 
2020-09-05 23:04:32,438 [nREPL-session-9c9fbc57-deda-45d2-a253-f666dcd61d84] DEBUG o.q.impl.jdbcjobstore.JobStoreTX - JobStore background threads shutdown. 
2020-09-05 23:04:32,438 [nREPL-session-9c9fbc57-deda-45d2-a253-f666dcd61d84] INFO  org.quartz.core.QuartzScheduler - Scheduler TestScheduler_$_NON_CLUSTERED shutdown complete. 
4. But this component can no longer start properly:
Execution error (ObjectAlreadyExistsException) at org.quartz.impl.jdbcjobstore.JobStoreSupport/storeJob (JobStoreSupport.java:1097).
Unable to store Job : 'DEFAULT.jobs.outbound-settlement-check-job.1', because one already exists with this identification.
Does anyone know what might be causing it? Something wrong with scheduler(didn't stop/clean the jobs table properly)? Or is it by design and job IDs must be unique?

nick 2020-09-05T20:25:17.015600Z

... or (shutdown scheduler) doesn't seem to properly shuts it down...

(user/stop)
{:stopped ["#'tr.db.core/*db*"]}2020-09-05 23:23:52,402 [QuartzScheduler_TestScheduler-NON_CLUSTERED_MisfireHandler] DEBUG o.q.impl.jdbcjobstore.JobStoreTX - MisfireHandler: scanning for misfires... 
2020-09-05 23:23:52,404 [QuartzScheduler_TestScheduler-NON_CLUSTERED_MisfireHandler] DEBUG o.q.impl.jdbcjobstore.JobStoreTX - Found 0 triggers that missed their scheduled fire-time. 
2020-09-05 23:23:55,871 [TestScheduler_QuartzSchedulerThread] DEBUG o.quartz.core.QuartzSchedulerThread - batch acquisition of 1 triggers 
2020-09-05 23:23:57,402 [QuartzScheduler_TestScheduler-NON_CLUSTERED_MisfireHandler] DEBUG o.q.impl.jdbcjobstore.JobStoreTX - MisfireHandler: scanning for misfires... 
2020-09-05 23:23:57,405 [QuartzScheduler_TestScheduler-NON_CLUSTERED_MisfireHandler] DEBUG o.q.impl.jdbcjobstore.JobStoreTX - Found 0 triggers that missed their scheduled fire-time. 
2020-09-05 23:24:02,402 [QuartzScheduler_TestScheduler-NON_CLUSTERED_MisfireHandler] DEBUG o.q.impl.jdbcjobstore.JobStoreTX - MisfireHandler: scanning for misfires... 
2020-09-05 23:24:02,405 [QuartzScheduler_TestScheduler-NON_CLUSTERED_MisfireHandler] DEBUG o.q.impl.jdbcjobstore.JobStoreTX - Found 0 triggers that missed their scheduled fire-time. 
Investigating. Any tips are still much appreciated

nick 2020-09-05T21:15:14.016200Z

http://www.quartz-scheduler.org/documentation/quartz-2.1.7/tutorials/tutorial-lesson-02.html "The name portion of the key of a job or trigger must be unique within the group - or in other words, the complete key (or identifier) of a job or trigger is the compound of the name and group."