简体   繁体   中英

Is there any way to create dynamic scheduler jobs (flows) in Mule deployed on CloudHub?

We have a scheduler flow already which runs on some times specified. Now for a new client we need the same flow to work.

Without having to add a new scheduler and duplicate the scheduler component with new details, is there any way to dynamically create those in Mule without redeploying the application? Or any other ways to achieve the functionality?

There is no out of the box way to create dynamically schedulers in Mule 4. An alternative is to develop your own message source in a custom connector to trigger the flow using the Mule Java SDK. Note that your custom connector will not be recognized as a scheduler in CloudHub UI. If you want to be able to manage you will have to implement an alternative.

What you are trying to achieve is not possible solely using Mule 4 or CloudHub. However, you can meet your requirement by combining with a scheduler service from any cloud provider. For example AWS's Amazon event bridge or GCP's Cloud Scheduler

So, in your Mule APP, you will replace your scheduler with an HTTP Listener ( <http:listener> ). Then, in your scheduler service, add a scheduler and configure it to send POST request to this HTTP endpoint. This POST request can have the required data that your mule app will need to identify the client, and perform customized action based on it. This way, whenever you want to add another client, you can just create a new scheduler in your cloud provider without needing to touch the mule application.

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