Monday 24 February 2014

Textual description of firstImageUrl

How To Write Cron Job In Mule : Example

Creating Cron Job or a Scheduler in Mule is very easy by using Mule's Quartz Transport . Here's is simple mule flow which triggered every five minutes .

You have to write cron expression in quartz endpoint of mule like this :
<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:jms="" xmlns:quartz="" xmlns="" xmlns:doc="" xmlns:spring="" version="CE-3.3.1" xmlns:xsi="" xsi:schemaLocation=" ">
    <spring:bean class="TestBean" name="test" id="test">
 <flow name="generateStockTicks" doc:name="generateStockTicks">
        <quartz:inbound-endpoint jobName="eventTimer" doc:name="Quartz" 
        cronExpression="0 0/5 * * * ?">
             <component doc:name="Java">
            <spring-object bean="test"/>
        <set-payload value="123456" doc:name="Set Payload"/>
        <logger message="Cron Job Running #[message.payload]" doc:name="Logger" level="INFO"/>

Download the complete source code of mule cron job example .

Post Comments and Suggestions !!