Asynchronous Job Processing Using Quartz.Net

Slides:



Advertisements
Similar presentations
MQ Series Cross Platform Dominant Messaging sw – 70% of market Messaging API same on all platforms Guaranteed one-time delivery Two-Phase Commit Wide EAI.
Advertisements

Concurrency (p2) synchronized (this) { doLecture(part2); } synchronized (this) { doLecture(part2); }
Message Queues COMP3017 Advanced Databases Dr Nicholas Gibbins –
Common Persistable Process Execution Runtime Native JVM Workflow Engine
Java Remote Object Invocation (RMI) Overview of RMI Java RMI allowed programmer to execute remote function class using the same semantics as local functions.
Java ThreadsGraphics Programming Graphics Programming: Java Threads.
Slide 1 of 9 Presenting 24x7 Scheduler The art of computer automation Press PageDown key or click to advance.
Google App Engine Google APIs OAuth Facebook Graph API
Workflow Management CMSC 491 Hadoop-Based Distributed Computing Spring 2015 Adam Shook.
ENTERPRISE JOB SCHEDULER SAJEEV RAMAKRISHNAN 29 AUG 2014.
This presentation will guide you though the initial stages of installation, through to producing your first report Click your mouse to advance the presentation.
Object Oriented Software Development
NDIS LBFO Miniports (Load Balancing And Failover) Larry Cleeton Program Manager Windows Networking And Communications Microsoft Corporation.
JSP Standard Tag Library
Programming Languages and Paradigms Object-Oriented Programming.
Christopher Jeffers August 2012
AIT 616 Fall 2002 PHP. AIT 616 Fall 2002 PHP  Special scripting language used to dynamically generate web documents  Open source – Free!!!  Performs.
© 2012 WIPRO LTD | 1 Version 1.0a, 23 rd April 2012 TTCN-3 Users Conference Practical integration of TTCN-3 with Robot test automation framework.
WhatsUp Gold v15 – WhatsUp Companion 3.7 WhatsUp Companion Extended
High Performance Computing Cluster OSCAR Team Member Jin Wei, Pengfei Xuan CPSC 424/624 Project ( 2011 Spring ) Instructor Dr. Grossman.
VBE easy VBE Release – New Features Available From 2 October 2006.
Maintaining a Mirrored Database Tips and Tricks by Paul G. Hiles.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Scheduling and Tasks Spring scheduling.
Spring core v3.x Prepared by: Nhan Le. History v3.0 Spring Expression Language Java based bean metadata v3.1 Cache Abstraction Bean Definition Profile.
REVIEW On Friday we explored Client-Server Applications with Sockets. Servers must create a ServerSocket object on a specific Port #. They then can wait.
The rSmart Group JA-SIG 2007 All Materials © 2007 The rSmart Group Sakai - SIS Integration Using Data Extracts John Bush The rSmart Group JA-SIG June 2007.
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 RMI.
RMI Continued IS Outline  Review of RMI  Programming example.
 Remote Method Invocation  A true distributed computing application interface for Java, written to provide easy access to objects existing on remote.
Exploring Quartz Scheduler
1 Interfacing & embedding. 2 References  Full tutorial and references Embedding and Interfacing Manual Windows - select “Documentation” from the ECLiPSe.
Java Commodity Grid (Java CogKit) Java CogKits allow developers to use commodity technologies such as Java or Python in programming the Grid based on Globus.
Review of Condor,SGE,LSF,PBS
Concurrency in Java Brad Vander Zanden. Processes and Threads Process: A self-contained execution environment Thread: Exists within a process and shares.
Consulting Services JobScheduler Architecture Decision Template Information for Consulting Parties Information for Consulting Parties.
 Load balancing is the process of distributing a workload evenly throughout a group or cluster of computers to maximize throughput.  This means that.
Li Tak Sing COMPS311F. RMI callbacks In previous example, only the client can initiate a communication with the server. The server can only response to.
Threads II IS Outline  Quiz  Thread review  Stopping a thread  java.util.Timer  Swing threads javax.swing.Timer  ProgressMonitor.
Cold Fusion Hosting The 5 “S”s for Success July 29, 2000 Presentation by Christine Pascarella Virtualscape.
Exceptions Chapter 16 This chapter explains: What as exception is Why they are useful Java exception facilities.
Consulting Services JobScheduler Architecture Decision Template Information for Consulting Parties Information for Consulting Parties.
Presented by Syed Baber Development Lead Mazik Global.
Oracle9i Performance Tuning Chapter 11 Advanced Tuning Topics.
Threads b A thread is a flow of control in a program. b The Java Virtual Machine allows an application to have multiple threads of execution running concurrently.
1 Lecture 15 Remote Method Invocation Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung Institute of Technology.
Activiti Dima Ionut Daniel. Contents What is Activiti? Activiti Basics Activiti Explorer Activiti Modeler Activiti Designer BPMN 2.0 Activiti Process.
Creating Simple and Parallel Data Loads With DTS.
Agenda UCMA 3.0 Highlights Management PowerShell cmdlets to create and manage UCMA trusted applications and endpoints. Autoprovisioning Application.
Interstage BPM v11.2 1Copyright © 2010 FUJITSU LIMITED INTERSTAGE BPM ARCHITECTURE BPMS.
CS 440 Database Management Systems Stored procedures & OR mapping 1.
Interstage BPM v11.2 1Copyright © 2010 FUJITSU LIMITED ADVANCE FEATURES.
1 Handling Errors and Exceptions Chapter 6. 2 Objectives You will be able to: 1. Use the try, catch, and finally statements to handle exceptions. 2. Raise.
Concurrent Programming in Java Based on Notes by J. Johns (based on Java in a Nutshell, Learning Java) Also Java Tutorial, Concurrent Programming in Java.
PHP – PHP Hypertext Processor A quick overview. How is PHP used? Embedded with HTML, e.g. Not like CGI: PHP files not an executable Used with servers.
#SummitNow Using Scheduler with Long Running Activiti Workflow Tasks 6 November 2013 (Barcelona) 14 November 2013 (Boston) Bill Young, Flatirons Solutions.
1. Advanced SQL Functions Procedural Constructs Triggers.
MQ Series Cross Platform Dominant Messaging sw – 70% of market
Chapter 3: Process Concept
1) CB plugin for Jenkins 2) Requirements Mapping
Consulting Services JobScheduler Architecture Decision Template
Out-of-Process Components
PHP / MySQL Introduction
null, true, and false are also reserved.
Time Gathering Systems Secure Data Collection for IBM System i Server
MQ Series Cross Platform Dominant Messaging sw – 70% of market
Out-of-Process Components
Outline Chapter 3: Processes Chapter 4: Threads So far - Next -
Plug-In Architecture Pattern
QlikView for use with SAP Netweaver Version 5.8 New Features
Presentation transcript:

Asynchronous Job Processing Using Quartz.Net Jay Vilalta jay.vilalta@gmail.com

What Is Quartz.Net Scheduler (think task scheduler) Queue for asynchronous jobs C# port of Quartz (java) Apache license

Why Use Quartz.Net Scale out Redundancy Smart handling of failures Job chaining (poor man’s workflow) Custom scheduling

How Can I Run It Embedded in your application As a stand alone windows service

The Basics Scheduler Jobs Triggers

Scheduler Runs jobs Manages the scheduling

Jobs Do the work Some built-in Mostly roll you own Implement IJob

Built-in Jobs FileScanJob: monitors last modified date NativeJob: runs executables or batch files NoOpJob: does nothing SendMailJob: sends emails

Jobs - Example public class MyJob : IJob { public void Execute(JobExecutionContext context) { try { int count= context.MergedJobDataMap.GetIntegerFromString(“count"); for (int i = 0; i < count; i++) { //do something useful } catch (ApplicationException ex) { throw new JobExecutionException("Something happened", ex, false);

Triggers Tell the scheduler when jobs should run Some built-in Simple Trigger Cron Trigger NthIncludedDayTrigger Custom Triggers

Simple Trigger Start Time Repeat Count Repeat Interval

Cron Trigger Similar to UNIX cron Start Time Cron Expression “0 15 10 ? * *” “0 0,15,30,45 * ? * *”

Custom Triggers No example this time Implementing a trigger is not trivial Must implement 11 methods Must be able to determine next fire time

Scheduling Associate a job to a trigger Multiple triggers can be set When the trigger fires, the job runs scheduler.ScheduleJob(jobDetail, trigger);

Advanced Features Listeners Special Jobs Remote management Clustering Plug-ins Unit testing

Listeners Job Listeners Trigger Listeners Scheduler Listeners Job and trigger listeners can be global

Job Listener Example public class JobHistoryListener : IJobListener { public void JobExecutionVetoed(…) public void JobToBeExecuted(…) public void JobWasExecuted(…) }

Trigger Listener Example public class MyTriggerListener:ITriggerListener { public string Name public void TriggerComplete(…) public void TriggerFired(…) public void TriggerMisfired(…) public bool VetoJobExecution(…) }

Special Jobs Stateful Jobs Interruptible Jobs

Stateful Jobs Only one can run at a time Allow you to save/restore state You must manage state yourself Implement IStatefulJob

Interruptible Jobs Mechanism to interrupt long running jobs You must implement yourself Implement IInterruptableJob

Remote Management Scheduler can be managed remotely Exposed via Remoting Most scheduler functions available

JobFactory Instantiates jobs Default factory creates a new instance Create your own if you use DI or IoC container

Job Stores RAMJobStore AdoJobStore MySql Oracle Postgres SQL Lite SQL Server

Clustering Load balancing Job Failover Caveat: clocks synchronized within a second

Plug-ins JobInitializationPlugin LoggingJobHistoryPlugin LoggingTriggerHistoryPlugin ShutdownHookPlugin

Plug-ins Stub public class SamplePlugin : ISchedulerPlugin { public void Initialize(string name, IScheduler sched) public void Shutdown() public void Start() }

Unit Testing You can / should unit test your quartz classes Use a mocking framework Mock the Scheduler (IScheduler) Mock a calendar (ICalendar) Use mocks to create your context

Sample Unit Test [Test] public void ExecuteTests() { JobDetail detail = new JobDetail(); IScheduler scheduler = new Mock<IScheduler>().Object; ICalendar calendar = new Mock<ICalendar>().Object; IJob job = new NoOpJob(); detail.Name = "Test"; detail.JobDataMap.Add("SOMETHING", "ELSE"); TriggerFiredBundle bundle = new TriggerFiredBundle(detail, new SimpleTrigger(), calendar, false, null, null, null, null); JobExecutionContext context = new JobExecutionContext(scheduler, bundle, job); JobHistoryListener listener = new JobHistoryListener(); listener.JobToBeExecuted(context); listener.JobWasExecuted(context, null); //methods return void so need to get creative to determine if execution was successful }

Resources Project Home: http://quartznet.sourceforge.net/ Mailing List: http://groups.google.com/group/quartznet Getting Started: http://jvilalta.blogspot.com