You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/07/24 06:38:50 UTC

[GitHub] [shardingsphere-elasticjob] Fengxu1234 commented on issue #1261: the job was offline, how to change the job to be online

Fengxu1234 commented on issue #1261:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1261#issuecomment-663370364


    @RequestMapping(value = "/addJob", method = RequestMethod.POST)
       public void addJob(@RequestBody String data, HttpServletRequest request, HttpServletResponse response) {
   
           JSONObject dataS = JSONObject.parseObject(data);
           String id = dataS.getString("id");
           String cron = dataS.getString("corn");
           JobCoreConfiguration coreConfig = JobCoreConfiguration.newBuilder("JobA" + id, cron, 1).jobParameter(Id).build();
           SimpleJobConfiguration simpleJobConfig = new SimpleJobConfiguration(coreConfig, JobA.class.getCanonicalName());
           JobScheduler jobScheduler = new JobScheduler(zookeeperRegistryCenter, LiteJobConfiguration.newBuilder(simpleJobConfig).build(),jobEventConfiguration);
         
               jobScheduler.init();
    
       }
   
   Passing parameter id to the JobA, ervery  id create a Job as "JobA"+id . This scenario , how to implement to be distributed ?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org