blob: 7e083d6f006e02ad60b78f3b62fd40cd06b65fa2 [file] [log] [blame]
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Job API on ElasticJob</title>
<link>https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/usage/job-api/</link>
<description>Recent content in Job API on ElasticJob</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-us</language>
<atom:link href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/usage/job-api/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Job Development</title>
<link>https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/usage/job-api/job-interface/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/usage/job-api/job-interface/</guid>
<description>ElasticJob-Lite and ElasticJob-Cloud provide a unified job interface, developers need to develop business jobs only once, and then they can be deployed to different environments according to different configurations and deployments.
ElasticJob has two kinds of job types: Class-based job and Type-based job. Class-based jobs require developers to weave business logic by implementing interfaces; Type-based jobs don&amp;rsquo;t need coding, just need to provide the corresponding configuration.
The method parameter shardingContext of the class-based job interface contains job configuration, slice and runtime information.</description>
</item>
<item>
<title>Use Java API</title>
<link>https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/usage/job-api/java-api/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/usage/job-api/java-api/</guid>
<description>Job configuration ElasticJob-Lite uses the builder mode to create job configuration objects. The code example is as follows:
JobConfiguration jobConfig = JobConfiguration.newBuilder(&amp;#34;myJob&amp;#34;, 3).cron(&amp;#34;0/5 * * * * ?&amp;#34;).shardingItemParameters(&amp;#34;0=Beijing,1=Shanghai,2=Guangzhou&amp;#34;).build(); Job start ElasticJob-Lite scheduler is divided into two types: timed scheduling and one-time scheduling. Each scheduler needs three parameters: registry configuration, job object (or job type), and job configuration when it starts.
Timed scheduling public class JobDemo { public static void main(String[] args) { // Class-based Scheduling Jobs new ScheduleJobBootstrap(createRegistryCenter(), new MyJob(), createJobConfiguration()).</description>
</item>
<item>
<title>Use Spring Boot Starter</title>
<link>https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/usage/job-api/spring-boot-starter/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/usage/job-api/spring-boot-starter/</guid>
<description>ElasticJob-Lite provides a customized Spring Boot Starter, which can be used in conjunction with Spring Boot. Developers are free from configuring CoordinatorRegistryCenter, JobBootstrap by using ElasticJob Spring Boot Starter. What developers need to solve distributed scheduling problem are job implementations with a little configuration.
Job configuration Implements ElasticJob Job implementation is similar to other usage of ElasticJob. The difference is that jobs will be registered into the Spring IoC container.</description>
</item>
<item>
<title>Use Spring Namespace</title>
<link>https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/usage/job-api/spring-namespace/</link>
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
<guid>https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/usage/job-api/spring-namespace/</guid>
<description>ElasticJob-Lite provides a custom Spring namespace, which can be used with the Spring. Through the way of DI (Dependency Injection), developers can easily use data sources and other objects that managed by the Spring container in their jobs, and use placeholders to get values ​​from property files.
Job Configuration &amp;lt;?xml version=&amp;#34;1.0&amp;#34; encoding=&amp;#34;UTF-8&amp;#34;?&amp;gt; &amp;lt;beans xmlns=&amp;#34;http://www.springframework.org/schema/beans&amp;#34; xmlns:xsi=&amp;#34;http://www.w3.org/2001/XMLSchema-instance&amp;#34; xmlns:elasticjob=&amp;#34;http://shardingsphere.apache.org/schema/elasticjob&amp;#34; xsi:schemaLocation=&amp;#34;http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://shardingsphere.apache.org/schema/elasticjob http://shardingsphere.apache.org/schema/elasticjob/elasticjob.xsd &amp;#34;&amp;gt; &amp;lt;!-- Configure registry center for job --&amp;gt; &amp;lt;elasticjob:zookeeper id=&amp;#34;regCenter&amp;#34; server-lists=&amp;#34;yourhost:2181&amp;#34; namespace=&amp;#34;my-job&amp;#34; base-sleep-time-milliseconds=&amp;#34;1000&amp;#34; max-sleep-time-milliseconds=&amp;#34;3000&amp;#34; max-retries=&amp;#34;3&amp;#34; /&amp;gt; &amp;lt;!</description>
</item>
</channel>
</rss>