sunkai-cai opened a new pull request #1980:
URL: https://github.com/apache/shardingsphere-elasticjob/pull/1980
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]