This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// URL for Jira's REST API for issues | |
var getIssueURL = "https://[Your Jira host]/rest/api/2/issue/"; | |
// Personally I prefer the script to handle request failures, hence muteHTTPExceptions = true | |
var fetchArgs = { | |
contentType: "application/json", | |
headers: {"Authorization":"Basic [Your BASE64 Encoded user:pass]"}, | |
muteHttpExceptions : true | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.yammer.metrics.core.HealthCheck; | |
import org.quartz.SchedulerException; | |
... | |
public class QuartzHealthCheck extends HealthCheck { | |
private QuartzManager quartzManager; | |
public QuartzSchedulerHealthCheck(QuartzManager qm) throws SchedulerException { | |
super("Quartz Scheduler Health Check"); | |
this.quartzManager = qm; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.yammer.dropwizard.config.Configuration; | |
... | |
public class QuartzConfiguration extends Configuration { | |
@Valid | |
@JsonProperty | |
private Map<String,String> quartzSettings = new HashMap<String, String>(); | |
public Properties getSchedulerFactoryProperties(){ | |
Properties sfProps = new Properties(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version='1.0' encoding='utf-8'?> | |
<job-scheduling-data xmlns="http://www.quartz-scheduler.org/xml/JobSchedulingData" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://www.quartz-scheduler.org/xml/JobSchedulingData http://www.quartz-scheduler.org/xml/job_scheduling_data_2_0.xsd" | |
version="2.0"> | |
<schedule> | |
<job> | |
<name>MySimpleJob</name> | |
<group>DailyJobs</group> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Other settings | |
# would go here | |
# Quartz Scheduler configuration | |
quartzSettings: | |
instanceName: MyQuartzScheduler | |
threadPoolClass: org.quartz.simpl.SimpleThreadPool | |
threadCount: 5 | |
threadPriority: 5 | |
jobStoreClass: org.quartz.simpl.RAMJobStore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class QuartzManager implements Managed { | |
private Scheduler scheduler; | |
private QuartzSchedulerMonitor schedulerMonitor; | |
private QuartzJobMonitor jobMonitor; | |
public QuartzManager(SchedulerFactory sf) throws SchedulerException { | |
scheduler = sf.getScheduler(); | |
schedulerMonitor = new QuartzSchedulerMonitor(); // Implements SchedulerListener | |
scheduler.getListenerManager().addSchedulerListener(schedulerMonitor); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.yammer.dropwizard.Service; | |
... | |
public class QuartzService extends Service<QuartzConfiguration> { | |
public static void main(String[] args) throws Exception { | |
new Quartz Service().run(args); | |
} | |
public QuartzService() { | |
super("Quartz Service"); |