Skip to main content

Posts

Showing posts with the label Quartz

Quartz Scheduler with SpringBoot

In the previous post,  Quartz Scheduler Introduction  we learned the basics of the Quartz subsystem with plain java. In this post, We will use spring boot magic to create an application with Quartz. This application will have the following. An endpoint, to show current items in the system. A quartz job, to keep adding a new item at a regular interval. Before we start with quartz, let's do some basic SpringBoot setup 1. Maven Project: Create a maven project the way you like, Either by using your favorite IDE or by command line or by  spring-starter .   just keep the name of your project as  QuartzSpringApplication  If you do not want to modify any code provided in this article After that add the following dependencies in your pom.xml.  Lombok  is not needed, but I like to use it everywhere. <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-webflux</artifactId> </dep...

An Introduction to Quartz Scheduler

It's a common use case to have an enterprise application, perform specific work, at a specific time or in response to a specific action. In other words, “There is an ask to execute a  Job  upon a predefined  Trigger ”. This brings us to the need for a  Scheduling System.  A system, where  Jobs  &  Trigger  can be registered and the system will manage the remaining complexity. Thankfully for the Java systems,  Quartz  is for rescue. It‘s an open-source library that has been extensively used in enterprise applications for more than a decade. Components in Quartz Sub System: Following are the all major component in the Quartz subsystem: Scheduler : It’s the control room of Quartz. It maintains everything required for scheduling,  such as managing listeners ,  scheduling jobs , clustering, transactions & job persistence. It maintains a registry of  JobDetails ,  Listeners  &  Triggers , and exec...