flyingbin
flyingbin

Reputation: 1097

In mule, how to invoke a class method via jmx

I use quartz to schedule a custom job to run daily, at a specific time.

However, the machine running mule may be down during that specific scheduled run time, and the custom job cannot get run on that day. So, I wonder if it is possible that I can use jmx to invoke the quartz custom job's execute() method manually.

Upvotes: 0

Views: 262

Answers (1)

David Dossot
David Dossot

Reputation: 33413

The easiest is to use a <composite-source> to allow your flow to be triggered both by Quartz and HTTP. That way you can manually trigger it with a simple curl invocation.

Something like:

<flow name="dualTriggerFlow">
    <composite-source>
        <quartz:inbound-endpoint ...>
        ...
        </quartz:inbound-endpoint>
       <http:inbound-endpoint exchange-pattern="request-response"
            host="localhost" port="8081" path="/jobs/myjob/trigger" />
    </composite-source>
    ...

Of course it depends on what type of Quartz job you're executing. I'm assuming an event-generator-job.

Upvotes: 1

Related Questions