{"id":33230095,"url":"https://github.com/spinscale/dropwizard-jobs","last_synced_at":"2025-11-21T11:01:56.709Z","repository":{"id":57730957,"uuid":"132052720","full_name":"spinscale/dropwizard-jobs","owner":"spinscale","description":"Quartz integration for dropwizard","archived":false,"fork":true,"pushed_at":"2018-05-03T21:43:13.000Z","size":255,"stargazers_count":2,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-05T07:06:02.088Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"dropwizard-jobs/dropwizard-jobs","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spinscale.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-03T21:42:40.000Z","updated_at":"2023-03-10T16:47:07.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/spinscale/dropwizard-jobs","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/spinscale/dropwizard-jobs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spinscale%2Fdropwizard-jobs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spinscale%2Fdropwizard-jobs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spinscale%2Fdropwizard-jobs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spinscale%2Fdropwizard-jobs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spinscale","download_url":"https://codeload.github.com/spinscale/dropwizard-jobs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spinscale%2Fdropwizard-jobs/sbom","scorecard":{"id":841593,"data":{"date":"2025-08-18","repo":{"name":"github.com/spinscale/dropwizard-jobs","commit":"984ba5328a6e118d25ffb3fe1f83b7df039306bd"},"scorecard":{"version":"v5.2.1-41-g40576783","commit":"40576783fda6698350fcbbeaea760ff827433034"},"score":1.7,"checks":[{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"112 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-vmq6-5m68-f53m","Warn: Project is vulnerable to: GHSA-668q-qrv7-99fm","Warn: Project is vulnerable to: GHSA-6v67-2wr5-gvf4","Warn: Project is vulnerable to: GHSA-pr98-23f8-jwxv","Warn: Project is vulnerable to: GHSA-h46c-h94j-95f3","Warn: Project is vulnerable to: GHSA-wf8f-6423-gfxg","Warn: Project is vulnerable to: GHSA-27xj-rqx5-2255","Warn: Project is vulnerable to: GHSA-288c-cq4h-88gq","Warn: Project is vulnerable to: GHSA-4gq5-ch57-c2mg","Warn: Project is vulnerable to: GHSA-4w82-r329-3q67","Warn: Project is vulnerable to: GHSA-57j2-w4cx-62h2","Warn: Project is vulnerable to: GHSA-58pp-9c76-5625","Warn: Project is vulnerable to: GHSA-5949-rw7g-wx7w","Warn: Project is vulnerable to: GHSA-5p34-5m6p-p58g","Warn: Project is vulnerable to: GHSA-5r5r-6hpj-8gg9","Warn: Project is vulnerable to: GHSA-5ww9-j83m-q7qx","Warn: Project is vulnerable to: GHSA-645p-88qh-w398","Warn: Project is vulnerable to: GHSA-6fpp-rgj9-8rwc","Warn: Project is vulnerable to: GHSA-6wqp-v4v6-c87c","Warn: Project is vulnerable to: GHSA-758m-v56v-grj4","Warn: Project is vulnerable to: GHSA-85cw-hj65-qqv9","Warn: Project is vulnerable to: GHSA-89qr-369f-5m5x","Warn: Project is vulnerable to: GHSA-8c4j-34r4-xr8g","Warn: Project is vulnerable to: GHSA-8w26-6f25-cm9x","Warn: Project is vulnerable to: GHSA-95cm-88f5-f2c7","Warn: Project is vulnerable to: GHSA-9gph-22xh-8x98","Warn: Project is vulnerable to: GHSA-9m6f-7xcq-8vf8","Warn: Project is vulnerable to: GHSA-9mxf-g3x6-wv74","Warn: Project is vulnerable to: GHSA-9vvp-fxw6-jcxr","Warn: Project is vulnerable to: GHSA-c265-37vj-cwcc","Warn: Project is vulnerable to: GHSA-c2q3-4qrh-fm48","Warn: Project is vulnerable to: GHSA-c8hm-7hpq-7jhg","Warn: Project is vulnerable to: GHSA-cf6r-3wgc-h863","Warn: Project is vulnerable to: GHSA-cjjf-94ff-43w7","Warn: Project is vulnerable to: GHSA-cmfg-87vq-g5g4","Warn: Project is vulnerable to: GHSA-cvm9-fjm9-3572","Warn: Project is vulnerable to: GHSA-f3j5-rmmp-3fc5","Warn: Project is vulnerable to: GHSA-f9hv-mg5h-xcw9","Warn: Project is vulnerable to: GHSA-f9xh-2qgp-cq57","Warn: Project is vulnerable to: GHSA-fmmc-742q-jg75","Warn: Project is vulnerable to: GHSA-fqwf-pjwf-7vqv","Warn: Project is vulnerable to: GHSA-gjmw-vf9h-g25v","Warn: Project is vulnerable to: GHSA-gwp4-hfv6-p7hw","Warn: Project is vulnerable to: GHSA-gww7-p5w4-wrfv","Warn: Project is vulnerable to: GHSA-h3cw-g4mq-c5x2","Warn: Project is vulnerable to: GHSA-h4rc-386g-6m85","Warn: Project is vulnerable to: GHSA-h822-r4r5-v8jg","Warn: Project is vulnerable to: GHSA-j823-4qch-3rgm","Warn: Project is vulnerable to: GHSA-jjjh-jjxp-wpff","Warn: Project is vulnerable to: GHSA-m6x4-97wx-4q27","Warn: Project is vulnerable to: GHSA-mc6h-4qgp-37qh","Warn: Project is vulnerable to: GHSA-mph4-vhrx-mv67","Warn: Project is vulnerable to: GHSA-mx7p-6679-8g3q","Warn: Project is vulnerable to: GHSA-mx9v-gmh4-mgqw","Warn: Project is vulnerable to: GHSA-p43x-xfjf-5jhr","Warn: Project is vulnerable to: GHSA-q93h-jc49-78gg","Warn: Project is vulnerable to: GHSA-qjw2-hr98-qgfh","Warn: Project is vulnerable to: GHSA-qmqc-x3r4-6v39","Warn: Project is vulnerable to: GHSA-qr7j-h6gg-jmgc","Warn: Project is vulnerable to: GHSA-r3gr-cxrf-hg25","Warn: Project is vulnerable to: GHSA-r695-7vr9-jgc2","Warn: Project is vulnerable to: GHSA-rf6r-2c4q-2vwg","Warn: Project is vulnerable to: GHSA-rgv9-q543-rqg4","Warn: Project is vulnerable to: GHSA-rpr3-cw39-3pxh","Warn: Project is vulnerable to: GHSA-v3xw-c963-f5hc","Warn: Project is vulnerable to: GHSA-v585-23hc-c647","Warn: Project is vulnerable to: GHSA-vfqx-33qm-g869","Warn: Project is vulnerable to: GHSA-wh8g-3j2c-rqj5","Warn: Project is vulnerable to: GHSA-x2w5-5m2g-7h5m","Warn: Project is vulnerable to: GHSA-h4x4-5qp2-wp46","Warn: Project is vulnerable to: GHSA-5mg8-w23w-74h3","Warn: Project is vulnerable to: GHSA-7g45-4rm6-3mm3","Warn: Project is vulnerable to: GHSA-mvr2-9pj6-7w5j","Warn: Project is vulnerable to: GHSA-84p2-vf58-xhxv","Warn: Project is vulnerable to: GHSA-q485-j897-qc27","Warn: Project is vulnerable to: GHSA-3mcp-9wr4-cjqf","Warn: Project is vulnerable to: GHSA-8jpx-m2wh-2v34","Warn: Project is vulnerable to: GHSA-j288-q9x7-2f5v","Warn: Project is vulnerable to: GHSA-cj7v-27pg-wf7q","Warn: Project is vulnerable to: GHSA-hmr7-m48g-48f6","Warn: Project is vulnerable to: GHSA-qh8g-58pp-2wxh","Warn: Project is vulnerable to: GHSA-26vr-8j45-3r4w","Warn: Project is vulnerable to: GHSA-6x9x-8qw9-9pp6","Warn: Project is vulnerable to: GHSA-7vx9-xjhr-rw6h","Warn: Project is vulnerable to: GHSA-84q7-p226-4x5w","Warn: Project is vulnerable to: GHSA-86wm-rrjm-8wh8","Warn: Project is vulnerable to: GHSA-9rgv-h7x4-qw8g","Warn: Project is vulnerable to: GHSA-g8m5-722r-8whq","Warn: Project is vulnerable to: GHSA-h2f4-v4c4-6wx4","Warn: Project is vulnerable to: GHSA-m394-8rww-3jr7","Warn: Project is vulnerable to: GHSA-m6cp-vxjx-65j6","Warn: Project is vulnerable to: GHSA-mwcx-532g-8pq3","Warn: Project is vulnerable to: GHSA-p26g-97m4-6q7c","Warn: Project is vulnerable to: GHSA-q4rv-gq96-w7c5","Warn: Project is vulnerable to: GHSA-qw69-rqj8-6qw8","Warn: Project is vulnerable to: GHSA-r28m-g6j9-r2h5","Warn: Project is vulnerable to: GHSA-xc67-hjx6-cgg6","Warn: Project is vulnerable to: GHSA-3gh6-v5v9-6v9j","Warn: Project is vulnerable to: GHSA-gwcr-j4wh-j3cq","Warn: Project is vulnerable to: GHSA-j26w-f9rq-mr2q","Warn: Project is vulnerable to: GHSA-g3wg-6mcf-8jj6","Warn: Project is vulnerable to: GHSA-58qw-p7qm-5rvh","Warn: Project is vulnerable to: GHSA-v6w3-2prq-h95f","Warn: Project is vulnerable to: GHSA-9qcf-c26r-x5rf","Warn: Project is vulnerable to: GHSA-3mc7-4q67-w48m","Warn: Project is vulnerable to: GHSA-98wm-3w3q-mw94","Warn: Project is vulnerable to: GHSA-9w3m-gqgf-c4p9","Warn: Project is vulnerable to: GHSA-c4r9-r8fh-9vj2","Warn: Project is vulnerable to: GHSA-hhhw-99gj-p3c3","Warn: Project is vulnerable to: GHSA-mjmj-j48q-9wg2","Warn: Project is vulnerable to: GHSA-rvwf-54qp-4r6v","Warn: Project is vulnerable to: GHSA-w37g-rhq8-7m4j"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T20:36:18.328Z","repository_id":57730957,"created_at":"2025-08-23T20:36:18.328Z","updated_at":"2025-08-23T20:36:18.328Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285603340,"owners_count":27200013,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-21T02:00:06.175Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-11-16T17:00:42.123Z","updated_at":"2025-11-21T11:01:56.703Z","avatar_url":"https://github.com/spinscale.png","language":"Java","funding_links":[],"categories":["Open Source"],"sub_categories":["Scheduled/Recurrence Jobs"],"readme":"[![Build Status](https://travis-ci.org/dropwizard-jobs/dropwizard-jobs.svg?branch=master)](https://travis-ci.org/dropwizard-jobs/dropwizard-jobs)\n\n# Dropwizard quartz integration\n\nThis plugin integrates the [quartz scheduler](http://quartz-scheduler.org/) with dropwizard and allows you to easily create background jobs, which are not bound to the HTTP request-response cycle.\nQuartz creates a threadpool on application startup and uses it for background jobs.\n\nThere are four different types of jobs:\n\n* Jobs run on application start for initial setup (could also be done via a managed instance in dropwizard)\n* Jobs run at application stop before the application is closed (could also be done via managed instance in dropwizard)\n* Jobs which are repeated after a certain time interval\n* Jobs which need to run at a specific time, via a cron-like expression\n\n## Using maven central repository\ndropwizard jobs can be used with maven.\nIt is located in Central Repository. http://search.maven.org/\n\nAdd to your pom:\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003eio.github.dropwizard-jobs\u003c/groupId\u003e\n  \u003cartifactId\u003edropwizard-jobs-core\u003c/artifactId\u003e\n  \u003cversion\u003e4.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## API changes from 3.x\nThe 3.x release has breaking API changes that would need to be addressed if upgrading from an older version. The\nsignature of the \u003ccode\u003edoJob()\u003c/code\u003e method has changed and now takes a \u003ccode\u003eJobExecutionContext\u003c/code\u003e as an\nargument and also throws a \u003ccode\u003eJobExecutionException\u003c/code\u003e.\n\n##### 3.x\n```java\n  @Override\n  public void doJob(JobExecutionContext context) throws JobExecutionException {\n    ...\n  }\n```\n\n##### \u003c 3.x\n```java\n  @Override\n  public void doJob() {\n    ...\n  }\n```\n\n\n## Installing the bundle from source code\n\n```\ngit clone https://github.com/dropwizard-jobs/dropwizard-jobs\ncd dropwizard-jobs\nmvn install\n```\n\nAfter installing the plugin locally you can include it in your pom.xml\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003eio.github.dropwizard-jobs\u003c/groupId\u003e\n  \u003cartifactId\u003edropwizard-jobs\u003c/artifactId\u003e\n  \u003cversion\u003e$VERSION\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Activating the bundle: Configuration\n\nYour Dropwizard application configuration class must implement `JobConfiguration`:\n\n```java\npublic class ApplicationConfiguration extends Configuration implements JobConfiguration {\n\n...\n\n}\n\n```\n\nBy default, `JobConfiguration` will return an empty configuration. If you want to allow configuring Quartz from your Dropwizard YML config file (recommended), then implement the `getQuartzConfiguration` method:\n\n```java\npublic class ApplicationConfiguration extends Configuration implements JobConfiguration {\n\n...\n    @JsonProperty(\"quartz\")\n    public Map\u003cString,String\u003e quartz;\n\n    @Override\n    public Map\u003cString,String\u003e getQuartzConfiguration() {\n        return quartz;\n    }\n}\n```\n\n## Activating the bundle: Initialization\n\nIn your application's `initialize` method, call `bootstrap.addBundle(new JobsBundle(\u003clist of jobs\u003e))`:\n\n```java\n@Override\npublic void initialize(Bootstrap\u003cMyConfiguration\u003e bootstrap) {\n  SomeDependency dependency = new Dependency();\n  Job startJob = new StartupJob();\n  Job stopJob = new StopJob();\n  Job everyJob = new EveryTestJob(dependency);\n  bootstrap.addBundle(new JobsBundle(startJob, stopJob, everyJob));\n}\n```\n\n## Available job types\n\nThe \u003ccode\u003e@OnApplicationStart\u003c/code\u003e annotation triggers a job after the quartz scheduler is started\n\n```java\n@OnApplicationStart\npublic class StartupJob extends Job {\n  @Override\n  public void doJob(JobExecutionContext context) throws JobExecutionException {\n    // logic run once on application start\n  }\n}\n```\n\nThe \u003ccode\u003e@OnApplicationStop\u003c/code\u003e annotation triggers a job when the application is stopped. Be aware that it is not guaranteed that this job is executed, in case the application is killed.\n\n```java\n@OnApplicationStop\npublic class StopJob extends Job {\n  @Override\n  public void doJob(JobExecutionContext context) throws JobExecutionException {\n    // logic run once on application stop\n  }\n}\n```\n\nThe \u003ccode\u003e@Every\u003c/code\u003e annotation first triggers a job after the quartz scheduler is started and then every n times, as it is configured. You can use a number and a time unit, which can be one of \"s\" for seconds, \"mn\" or \"min\" for minutes, \"h\" for hours and \"d\" for days.\nUse in conjunction with \u003ccode\u003e@DelayStart\u003c/code\u003e to delay the first invocation of this job.\n\n```java\n@Every(\"1s\")\npublic class EveryTestJob extends Job {\n  @Override\n  public void doJob(JobExecutionContext context) throws JobExecutionException {\n    // logic run every time and time again\n  }\n}\n```\n\nThe \u003ccode\u003e@DelayStart\u003c/code\u003e annotation can be used in conjunction with @Every to delay the start of the job. Without this, all the @Every jobs start up at the same time when the scheduler starts.\n\n```java\n@DelayStart(\"5s\")\n@Every(\"1s\")\npublic class EveryTestJobWithDelayedStart extends Job {\n  @Override\n  public void doJob(JobExecutionContext context) throws JobExecutionException {\n    // logic run every time and time again\n  }\n}\n```\n\nThe \u003ccode\u003e@On\u003c/code\u003e annotation allows one to use cron-like expressions for complex time settings. You can read more about possible cron expressions at http://quartz-scheduler.org/documentation/quartz-2.1.x/tutorials/tutorial-lesson-06\n\nThis expression would run on Mondays at 1pm, Los Angeles time. If the optional parameter `timeZone` is not set system default will be used. \n\n```java\n@On(\"0 0 13 ? * MON\", timeZone = \"America/Los_Angeles\")\npublic class OnTestJob extends Job {\n  @Override\n  public void doJob(JobExecutionContext context) throws JobExecutionException {\n    // logic run via cron expression\n  }\n}\n```\n\nBy default a class can only be scheduled once in the jobs bundle, this can be overridden by setting a unique `groupName` to the instance.\n```java\n@Every(\"15m\")\npublic class GroupNameJob extends Job {\n  public GroupNameJob(String groupName) {\n      super(groupName);\n  }\n}\n```\n\n## Using dropwizard-jobs in a Clustered Environment\n\nBy default, dropwizard-jobs is designed to be used with an in-memory Quartz scheduler. If you wish to deploy it in a clustered environment that consists of more than one node, you'll need to use a scheduler that has some sort of persistence. You can either add a file called `quartz.properties` to your classpath or you can provide the quartz configuration in your Dropwizard configuration file. The content of the `quartz` element is passed to the Quartz scheduler directly (so you can take the properties from the official docs). If you'd like to add the config to your Dropwizard configuration file, you need to override the `getQuartzConfiguration()` method in your application's configuration. You can set the map to `DefaultQuartzConfiguration.get()`.\n\nSee the full Quartz configuration reference at http://www.quartz-scheduler.org/documentation/quartz-2.x/configuration/\n```yaml\n[...]\nquartz:\n  org.quartz.scheduler.instanceName: \"scheduler\"\n  org.quartz.scheduler.instanceId: \"AUTO\"\n  org.quartz.scheduler.skipUpdateCheck: \"true\"\n  org.quartz.threadPool.class: \"org.quartz.simpl.SimpleThreadPool\"\n  org.quartz.threadPool.threadCount: \"10\"\n  org.quartz.threadPool.threadPriority: \"5\"\n  org.quartz.jobStore.misfireThreshold: \"60000\"\n  org.quartz.jobStore.class: \"org.quartz.impl.jdbcjobstore.JobStoreTX\"\n  org.quartz.jobStore.driverDelegateClass: \"org.quartz.impl.jdbcjobstore.StdJDBCDelegate\"\n  org.quartz.jobStore.useProperties: \"false\"\n  org.quartz.jobStore.dataSource: \"myDS\"\n  org.quartz.jobStore.tablePrefix: \"QRTZ_\"\n  org.quartz.jobStore.isClustered: \"true\"\n  org.quartz.dataSource.myDS.driver: \"com.mysql.cj.jdbc.Driver\"\n  org.quartz.dataSource.myDS.URL: \"jdbc:mysql://localhost:3306/quartz\"\n  org.quartz.dataSource.myDS.user: \"fami\"\n  org.quartz.dataSource.myDS.password: \"ageClXl5mrSg\"\n  org.quartz.dataSource.myDS.maxConnections: \"5\"\n  org.quartz.dataSource.myDS.validationQuery: \"select 1\"\n```\n\nWhen you do this, dropwizard-jobs will ensure that only one instance of each job is scheduled, regardless of the number of nodes in your cluster by using the fully-qualified class name of your job implementation as the name of your job. For example, if your job implementation resides in a class called `MyJob`, which in turn is located in the package `com.my.awesome.web.app`, then the name of your job (so far as Quartz is concerned) will be `com.my.awesome.web.app.MyJob`.\n\nIf you wish to override the default name that dropwizard-jobs assigns to your job, you can do so by setting the `jobName` property in the `@Every` or `@On` annotation like so:\n\n```Java\npackage com.my.awesome.web.app\n\n/**\n * This job will be given the name \"MyJob\" instead of the name \"com.my.awesome.web.app.MyJob\"\n */\n@Every(value=\"5s\", jobName=\"MyJob\")\npublic class MyJob extends Job {\n  @Override\n  public void doJob(JobExecutionContext context) throws JobExecutionException {\n    // do some work here\n  }\n}\n```\nThis property is not supported in the `@OnApplicationStart` or `@ApplicationStop` annotations, as they are designed for jobs that will fire reliably when Dropwizard starts or stops your web application. As such, jobs annotated with `@OnApplicationStart` or `@OnApplicationStop` will be given unique names, and will be fired according to schedule on every node in your cluster.\n\n## Configuring jobs in the Dropwizard Config File\n\nAs of 1.0.2, the period for @Every jobs can be read from the dropwizard config file instead of being hard-coded. The YAML looks like this:\n\n```\njobs:\n  myJob: 10s\n  myOtherJob: 20s\n  cronJob: \"0 0/3 0 ? * * *\"\n```\n\nWhere MyJob and MyOtherJob are the names of Job classes in the application. In the \u003ccode\u003eConfiguration\u003c/code\u003e class add the corresponding property:\n\n```java\n@JsonProperty(\"jobs\")\nprivate Map\u003cString , String\u003e jobs;\n\npublic Map\u003cString, String\u003e getJobs() {\n    return jobs;\n}\n\npublic void setJobs(Map\u003cString, String\u003e jobs) {\n    this.jobs = jobs;\n}\n```\n\nThen the \u003ccode\u003e@Every\u003c/code\u003e annotation can be used without a value, its value is set from the configuration:\n\n```java\n@Every\npublic class MyJob extends Job {\n    ...\n}\n```\n\nAn alternative label to the class name can also be specified:\n\n```java\n@Every(\"${foobar}\")\npublic class MyJob extends Job {\n    ...\n}\n```\nThe same can be done with the \u003ccode\u003e@On\u003c/code\u003e annotation as well, as second option to cron-base jobs configuration\nAn alternative label to the class name can also be specified:\n\n```java\n@On(\"${cronJob}\")\npublic class MyJob extends Job {\n    ...\n}\n```\n\nSo long as there is a matching property in the YAML:\n\n```\njobs:\n  foobar: 10s\n```\n\n# Limitations\n* Configuration mechanism is still in early stages. Might be enhanced in the future.\n\n# Thanks\n\n* The playframework 1.x for the idea of simple annotations at Job classes\n\n# Contributors\n * [Alexander Reelsen](https://github.com/spinscale)\n * [Hakan Dilek](https://github.com/hakandilek)\n * [Yun Zhi Lin](https://github.com/yunspace)\n * [Eyal Golan](https://github.com/eyalgo)\n * [Jonathan Fritz](https://github.com/MusikPolice)\n * [Ahsan Rabbani](https://github.com/xargsgrep)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspinscale%2Fdropwizard-jobs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspinscale%2Fdropwizard-jobs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspinscale%2Fdropwizard-jobs/lists"}