简体   繁体   中英

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.

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM