Mule with quartz
-
Upload
anirban-sen-chowdhary -
Category
Technology
-
view
143 -
download
1
Transcript of Mule with quartz
By Anirban Sen Chowdhary
Quartz transport can be used in Mule application to schedule an event to take place.An inbound quartz endpoint can be used to trigger inbound events that can be repeated, such as every second. Outbound quartz endpoints can be used to schedule an existing event to fire at a later date. Users can create schedules using cron expressions, and events can be persisted in a database.
Source: MuleSoft
Cron Expressions: A cron expression is a string comprised by six or seven fields separated by white space. Fields can contain any of the allowed values, along with various combinations of the allowed special characters for that field.We can use cron expressions to create schedulersExample of cron expression :Cron expressions can be as simple as this:* * * * ? *or more complex, like this:0 0/5 14,18,3-39,52 ? JAN,MAR,SEP MON-FRI 2002-2010.
Source: MuleSoft
Jobs :- Jobs are used to perform an action when a time trigger occurs from the Quartz transport. Mule provides a number of jobs for generating and scheduling events.
Source: MuleSoft
Now let’s test an application with Quartz
Let’s suppose we have a simple application designed to write a file to an outbound endpoint at a specific interval of time as follow :-
The mule config will be as follow :-
As you can see the flow is designed to write a file to a folder at a specific interval of time
We start and run our application as follow:-
We can find the application has start working and the Quartz is making the flow to write the file in the outbound endpoint after each specific interval of time
In the outbound folder you can see the files are generated at each interval of time:-
In my next slide I will bring some other techniques in Mule implementation .Hope you have enjoyed this simpler version.Keep sharing your knowledge and let our Mule community grow