14
Basic Example using QUARTZ Component in Anypoint Studio Prudhvi

Basic example using quartz component in anypoint studio

Embed Size (px)

Citation preview

Page 1: Basic example using quartz component in anypoint studio

Prudhvi

Basic Example using QUARTZ Component in

Anypoint Studio

Page 2: Basic example using quartz component in anypoint studio

Prudhvi

Abstract Use of Quartz component in Anypoint

Studio using Basic Example

Page 3: Basic example using quartz component in anypoint studio

Prudhvi

Introduction The Quartz transport provides support for

scheduling events and for triggering new events. 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.

Page 4: Basic example using quartz component in anypoint studio

Prudhvi

Quartz Flow

Page 5: Basic example using quartz component in anypoint studio

Prudhvi

Configuring Quartz

We can configure Repeat interval or we can use cron expression.Example of CRON Expression:0 0 12 * * ? (Fire at 12pm (noon) every day)

Page 6: Basic example using quartz component in anypoint studio

Prudhvi

In Quartz: Configuring Job

Page 7: Basic example using quartz component in anypoint studio

Prudhvi

Page 8: Basic example using quartz component in anypoint studio

Prudhvi

In Quartz : Configuring Connector Configuration

Page 9: Basic example using quartz component in anypoint studio

Prudhvi

Configuring Logger

Page 10: Basic example using quartz component in anypoint studio

Prudhvi

XML Configuration File<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:quartz="http://www.mulesoft.org/schema/mule/quartz" xmlns="http://www.mulesoft.org/schema/mule/core"

xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"

xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.6.1"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-

beans-current.xsd

http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd

http://www.mulesoft.org/schema/mule/quartz http://www.mulesoft.org/schema/mule/quartz/current/mule-quartz.xsd">

<quartz:connector name="Quartz" validateConnections="true" doc:name="Quartz"/>

<flow name="BasicQuartz">

<quartz:inbound-endpoint responseTimeout="10000" doc:name="Quartz" connector-ref="Quartz" jobName="Trigger"

repeatCount="10" repeatInterval="30000">

<quartz:event-generator-job/>

</quartz:inbound-endpoint>

<logger message="Quartz trigger" level="INFO" doc:name="Logger"/>

</flow>

</mule>

Page 11: Basic example using quartz component in anypoint studio

Prudhvi

Run the Application

Page 12: Basic example using quartz component in anypoint studio

Prudhvi

Result

Successfully triggered 10 times as we configured in QUARTZ

Page 13: Basic example using quartz component in anypoint studio

Prudhvi

Reference Mulesoft:

https://docs.mulesoft.com/mule-user-guide/v/3.7/quartz-transport-reference

Page 14: Basic example using quartz component in anypoint studio

Prudhvi

THANK YOU