{"id":25643454,"url":"https://github.com/robinjhector/dropwizard-quartz","last_synced_at":"2026-06-03T16:31:03.116Z","repository":{"id":173648124,"uuid":"118966584","full_name":"robinjhector/dropwizard-quartz","owner":"robinjhector","description":"Easy to use dropwizard integration with quartz","archived":false,"fork":false,"pushed_at":"2018-03-12T13:26:56.000Z","size":30,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-02-23T06:29:45.078Z","etag":null,"topics":["dropwizard","jobs","quartz","scheduling"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robinjhector.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-25T20:54:24.000Z","updated_at":"2018-07-27T07:40:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"825f8269-99d9-49b4-833b-d41f01abeb30","html_url":"https://github.com/robinjhector/dropwizard-quartz","commit_stats":null,"previous_names":["robinjhector/dropwizard-quartz"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/robinjhector/dropwizard-quartz","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robinjhector%2Fdropwizard-quartz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robinjhector%2Fdropwizard-quartz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robinjhector%2Fdropwizard-quartz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robinjhector%2Fdropwizard-quartz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robinjhector","download_url":"https://codeload.github.com/robinjhector/dropwizard-quartz/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robinjhector%2Fdropwizard-quartz/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33874679,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-03T02:00:06.370Z","response_time":59,"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":["dropwizard","jobs","quartz","scheduling"],"created_at":"2025-02-23T06:27:04.229Z","updated_at":"2026-06-03T16:31:03.110Z","avatar_url":"https://github.com/robinjhector.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Quartz integration for Dropwizard\n\n[![Build Status](https://travis-ci.org/izrobin/dropwizard-quartz.svg?branch=master)](https://travis-ci.org/izrobin/dropwizard-quartz)\n\n### About\nThis project aims to ease the integration of quartz to Dropwizard, by making configuration easy with annotations and simple configuration.\n\n### Get started\n\nModify your existing Dropwizard configuration class, to implement the interface `QuartzConfiguration`.\nIf you want, you can implement the method `getQuartzConfiguration`, to specify quartz-specific configuration, in key-value pairs.\nSee the [Quartz Documentation](http://www.quartz-scheduler.org/documentation/quartz-2.x/configuration/) for allowed configuration values.\nOtherwise a default config will be used.\n\nCreate some job classes. Each class needs to inherit from `AbstractJob`.\nThe constructor of this class takes 3 optional parameters:\n\n| Parameter         | Default                                                 | Description                                                                                     |\n| ----------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------|\n| jobName           | getClass().getCanonicalName()                           | The name for your job, as registered by the Quartz scheduler                                    |\n| jobGroup          | \"DEFAULT\"                                               | The group, that your job belongs to. The combination of jobName and jobGroup needs to be unique |\n| metricsRegistry   | SharedMetricRegistries.getOrCreate(\"dropwizard-quartz\") | A custom metrics registry to measure timing etc.                                                |\n\nTo configure scheduling for your job, see [Scheduling](#scheduling)\n\nInstantiate all of your job classes, with their needed dependencies, \nand then manage the `QuartzManager` with the lifecycle.\n\nExample of an application class:\n\n```java\npublic class MyApplication extends Application\u003cMyConfiguration\u003e {\n\n    public static void main(final String[] args) throws Exception {\n        new MyApplication().run(args);\n    }\n\n    @Override\n    public void run(final MyConfiguration config, final Environment environment) throws Exception {\n        final Set\u003cAbstractJob\u003e jobs = new HashSet\u003c\u003e(Arrays.asList(\n            new MyJobClass(),\n            new AnotherJobClass()\n        ));\n        final QuartzManager quartzManager = new QuartzManager(\n            config,\n            jobs\n        );\n        environment.lifecycle().manage(quartzManager);\n    }\n}\n```\n\n\n### Scheduling\n\nThere are multiple ways of scheduling your jobs with dropwizard-quartz. The simplest way is to use annotations:\n\n#### Interval\n```java\n@Interval(frequency = 2, timeUnit = ChronoUnit.MINUTES)\npublic class MyJob extends AbstractJob {\n    @Override\n    public void executeJob(final JobExecutionContext ctx) {\n        //Your job code\n    }\n}\n```\nAbove job will be run every 2 minutes, indefinitely \n\n#### Cron\n```java\n@Cron(value = \"0 0 2 ? DEC *\", timeZone = \"UTC\")\npublic class MyJob extends AbstractJob {\n    @Override\n    public void executeJob(final JobExecutionContext ctx) {\n        //Your job code\n    }\n}\n```\nAbove job will be run at 2am every day in december, at UTC time.\n\n\n#### On Event\n```java\n@OnEvent(EventType.APPLICATION_START)\npublic class MyJob extends AbstractJob {\n    @Override\n    public void executeJob(final JobExecutionContext ctx) {\n        //Your job code\n    }\n}\n```\nAbove job will be run as soon as Quartz is configured and running. \nThere are 2 types of events built-in:\n - `EventType.APPLICATION_START`\n - `EventType.APPLICATION_STOP`\n \nMore events might be added in the future.\n\n#### Initial Delay\n```java\n@InitialDelay(delay = 5, timeUnit = ChronoUnit.SECONDS)\n@Interval(frequency = 5, timeUnit = ChronoUnit.MINUTES)\npublic class MyJob extends AbstractJob {\n    @Override\n    public void executeJob(final JobExecutionContext ctx) {\n        //Your job code\n    }\n}\n```\n\nAll types of scheduling supports the use of an initial delay. \nThe above class will be executed 5 minutes after `APPLICATION_START`, \nand executed every 5 minutes after that, indefinitely  \n\n\n#### Custom annotations\n\nYou can easily extend this library by creating your own custom annotations for scheduling.\nTo do so, create a class implementing `CustomTriggerBuilder`. Implement the two methods:\n\n```java\nboolean canBuildTrigger(final AbstractJob job);\n```\nA qualifying method to determine if your TriggerBuilder should built the trigger for the supplied `AbstractJob`.\n\n```java\nSet\u003c? extends Trigger\u003e buildTriggers(final AbstractJob job);\n```\nReturn a set of triggers to be scheduled for this job.\n\nAnd later add it to the `QuartzManager`\n\n````java\nfinal Set\u003cCustomTriggerBuilder\u003e customTriggerBuilders = ...\nfinal QuartzManager quartzManager = new QuartzManager(\n            config,\n            jobs,\n            customTriggerBuilders\n        );\n````\n\n\n##### Custom triggers via code\n\nIf the above seems like too much work, you can also let your job class itself, declare the triggers.\nImplement the interface `FineTunedTriggers` directly from your class extending `AbstractJob`.\nAnd return your desired triggers in `Set\u003c? extends Trigger\u003e getTriggers();`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobinjhector%2Fdropwizard-quartz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobinjhector%2Fdropwizard-quartz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobinjhector%2Fdropwizard-quartz/lists"}