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 2021/09/27 03:47:36 UTC

[GitHub] [shardingsphere-elasticjob] sunkai-cai opened a new pull request #1982: Support annotation job java

sunkai-cai opened a new pull request #1982:
URL: https://github.com/apache/shardingsphere-elasticjob/pull/1982


   Fixes #1445.
   
   Part one.
   
   Changes proposed in this pull request:
   - add annotation interface `@ElasticJobConfiguration`
   - add JobAnnotationBuilder
   - `ScheduleJobBootstrap` and `OneOffJobBootstrap` support annotation job
   
   //Java example:
   
   ```
   @ElasticJobConfiguration(
           cron = "0/5 * * * * ?",
           jobName = "SimpleTestJobFirst",
           shardingTotalCount = 3,
           shardingItemParameters = "0=Beijing,1=Shanghai,2=Guangzhou",
           jobListenerTypes = {"NOOP", "LOG"},
           props = {
                   @ElasticJobProp(key = "print.title", value = "test title"),
                   @ElasticJobProp(key = "print.content", value = "test content")
           }
   )
   public class SimpleTestJob implements CustomJob {
       
       @Override
       public void execute(final ShardingContext shardingContext) {
       }
       
   }
   ```
   
   ```
   public final class JavaMain {
       .....
       public static void main(final String[] args) throws IOException {
           CoordinatorRegistryCenter regCenter = setUpRegistryCenter();
           (new ScheduleJobBootstrap(regCenter,new SimpleTestJob())).schedule();
       }
       .....
   }
   ```
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

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



[GitHub] [shardingsphere-elasticjob] TeslaCN merged pull request #1982: Support annotation job java

Posted by GitBox <gi...@apache.org>.
TeslaCN merged pull request #1982:
URL: https://github.com/apache/shardingsphere-elasticjob/pull/1982


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

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