shardingsphere-elasticjob icon indicating copy to clipboard operation
shardingsphere-elasticjob copied to clipboard

Can I manually trigger a job with specific jobParameter?

Open zewade opened this issue 3 years ago • 2 comments

As we use elastic job lite v2.1.5, can I manually trigger a job with specific jobParameter? For exmaple, My timed tasks are usually performed once a day and work only on that day's data. But sometimes due to some reason, such as system failure, the execution of the day timed task is missed. How to manually trigger a timed task the next day and pass the previous day's time period through a parameter. My job can receive a parameter of time period of data needs to be handled.

zewade avatar Jan 11 '21 08:01 zewade

I have some ideas about this issue:

  1. Consider starting a job for manual trigger only;
  2. Specify jobParameter by ElasticJob Console.

TeslaCN avatar Jan 12 '21 14:01 TeslaCN

Hi @TeslaCN I've achieved the feature by modifying Lite-Core and Admin Console. The basic idea is to pass the specific job parameter by Admin Console and persist the specific job parameter to ZK. The TriggerListenerManager receives the data changed and triggers the job with the specific job parameter. I would like to contribute the code to the community. Any suggestions about what I can do next are appreciated.

onehwl avatar Sep 15 '22 09:09 onehwl