Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mule flow to Read Queue messages in Quartz Scheduler and forward to a Java component

Tags:

mule

How do I write a Mule flow to use a Quartz Scheduler to read messages from Queue on regular interval (cron)?

My first flow includes a CXF->Queue. I need this in my second flow: Queue->Quartz->Component

  <quartz:inbound-endpoint jobName="ReadQIN" cronExpression="* * * * * ?" repeatInterval="0" doc:name="Quartz">
        <quartz:endpoint-polling-job groupName="ReadQINGroup" jobGroupName="ReadQINJobGroup">
            <quartz:job-endpoint address="jms://QIN"/>
        </quartz:endpoint-polling-job>
    </quartz:inbound-endpoint>

It ended in org.quartz.SchedulerException: Trigger does not reference given job!

like image 937
Udhay Avatar asked Feb 22 '23 05:02

Udhay


1 Answers

If you provide a "cronExpression" don't provide a "repeatInterval". Also just do not provide values for "groupName" and "jobGroupName" (they are for advanced usage of the underlying Quartz infrastructure).

With these changes applied, the following works fine for me:

    <quartz:inbound-endpoint jobName="ReadQIN"
        cronExpression="* * * * * ?"  doc:name="Quartz">
        <quartz:endpoint-polling-job>
            <quartz:job-endpoint address="jms://QIN" />
        </quartz:endpoint-polling-job>
    </quartz:inbound-endpoint>
like image 119
David Dossot Avatar answered Feb 23 '23 18:02

David Dossot