Udhay
Udhay

Reputation: 81

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

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!

Upvotes: 4

Views: 2545

Answers (1)

David Dossot
David Dossot

Reputation: 33413

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>

Upvotes: 8

Related Questions