blob: 5e2a1e28bdb8a5463cefbc393ba28025994b171b [file] [log] [blame]
<!DOCTYPE html>
<html lang="en" class="js csstransforms3d">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="generator" content="Hugo 0.70.0" />
<meta name="description" content="">
<meta name="buildDate" content="2020-10-19 20:55:12">
<link rel="shortcut icon" href="https://shardingsphere.apache.org/elasticjob/images/favicon.png" type="image/x-icon" />
<title>Use Spring Boot Starter :: ElasticJob</title>
<link href="https://shardingsphere.apache.org/elasticjob/current/css/nucleus.css?1603112112" rel="stylesheet">
<link href="https://shardingsphere.apache.org/elasticjob/current/css/font-awesome.min.css?1603112112" rel="stylesheet">
<link href="https://shardingsphere.apache.org/elasticjob/current/css/hybrid.css?1603112112" rel="stylesheet">
<link href="https://shardingsphere.apache.org/elasticjob/current/css/featherlight.min.css?1603112112" rel="stylesheet">
<link href="https://shardingsphere.apache.org/elasticjob/current/css/perfect-scrollbar.min.css?1603112112" rel="stylesheet">
<link href="https://shardingsphere.apache.org/elasticjob/current/css/auto-complete.css?1603112112" rel="stylesheet">
<link href="https://shardingsphere.apache.org/elasticjob/current/css/theme.css?1603112112" rel="stylesheet">
<link href="https://shardingsphere.apache.org/elasticjob/current/css/hugo-theme.css?1603112112" rel="stylesheet">
<link href="https://shardingsphere.apache.org/elasticjob/current/css/theme-black.css?1603112112" rel="stylesheet">
<script src="https://shardingsphere.apache.org/elasticjob/current/js/jquery-2.x.min.js?1603112112"></script>
<style type="text/css">
:root #header + #content > #left > #rlblock_left{
display:none !important;
}
</style>
</head>
<body class="" data-url="/en/user-manual/elasticjob-lite/usage/job-api/spring-boot-starter/">
<nav id="sidebar" class="">
<div id="header-wrapper">
<div id="header">
<img src="https://shardingsphere.apache.org/elasticjob/current/img/elasticjob.png" />
</div>
</div>
<div class="highlightable">
<ul class="topics">
<li data-nav-id="/en/overview/" title="Overview" class="dd-item
">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/overview/">
<i class="collapse" style="display:inline; font-family:'courier';">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
</i>
<b>1. </b>Overview
</a>
</li>
<li data-nav-id="/en/quick-start/" title="Quick Start" class="dd-item
">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/quick-start/">
<i class="collapse" style="display:inline; font-family:'courier';">
<svg class="icon icon-down"
style="display: none;"
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#777">
<path d="M500.8 604.778667L267.306667 371.392l-45.226667 45.269333 278.741333 278.613334 278.485334-278.613334-45.248-45.248z" p-id="5376" ></path>
</svg>
<svg class="icon icon-right"
style="display: inline-block;"
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#777">
<path d="M593.450667 512.128L360.064 278.613333l45.290667-45.226666 278.613333 278.762666L405.333333 790.613333l-45.226666-45.269333z" p-id="5605" ></path>
</svg>
</i>
<b>2. </b>Quick Start
</a>
<ul>
<li data-nav-id="/en/quick-start/elasticjob-lite/" title="ElasticJob-Lite" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/quick-start/elasticjob-lite/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
<b>2.1. </b>ElasticJob-Lite
</a>
</li>
<li data-nav-id="/en/quick-start/elasticjob-cloud/" title="ElasticJob-Cloud" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/quick-start/elasticjob-cloud/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
<b>2.2. </b>ElasticJob-Cloud
</a>
</li>
</ul>
</li>
<li data-nav-id="/en/features/" title="Concepts &amp; Features" class="dd-item
">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/features/">
<i class="collapse" style="display:inline; font-family:'courier';">
<svg class="icon icon-down"
style="display: none;"
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#777">
<path d="M500.8 604.778667L267.306667 371.392l-45.226667 45.269333 278.741333 278.613334 278.485334-278.613334-45.248-45.248z" p-id="5376" ></path>
</svg>
<svg class="icon icon-right"
style="display: inline-block;"
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#777">
<path d="M593.450667 512.128L360.064 278.613333l45.290667-45.226666 278.613333 278.762666L405.333333 790.613333l-45.226666-45.269333z" p-id="5605" ></path>
</svg>
</i>
<b>3. </b>Concepts &amp; Features
</a>
<ul>
<li data-nav-id="/en/features/schedule-model/" title="Schedule Model" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/features/schedule-model/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
<b>3.1. </b>Schedule Model
</a>
</li>
<li data-nav-id="/en/features/elastic/" title="Elastic Schedule" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/features/elastic/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
<b>3.2. </b>Elastic Schedule
</a>
</li>
<li data-nav-id="/en/features/resource/" title="Resource Assign" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/features/resource/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
<b>3.3. </b>Resource Assign
</a>
</li>
<li data-nav-id="/en/features/failover/" title="Failover" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/features/failover/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
<b>3.4. </b>Failover
</a>
</li>
<li data-nav-id="/en/features/misfire/" title="Misfire" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/features/misfire/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
<b>3.5. </b>Misfire
</a>
</li>
<li data-nav-id="/en/features/job-type/" title="Job Open Ecosystem" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/features/job-type/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
<b>3.6. </b>Job Open Ecosystem
</a>
</li>
</ul>
</li>
<li data-nav-id="/en/user-manual/" title="User Manual" class="dd-item
parent
">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/">
<i class="collapse" style="display:inline; font-family:'courier';">
<svg class="icon icon-down"
style="display: inline-block;"
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#777">
<path d="M500.8 604.778667L267.306667 371.392l-45.226667 45.269333 278.741333 278.613334 278.485334-278.613334-45.248-45.248z" p-id="5376" ></path>
</svg>
<svg class="icon icon-right"
style="display: none;"
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#777">
<path d="M593.450667 512.128L360.064 278.613333l45.290667-45.226666 278.613333 278.762666L405.333333 790.613333l-45.226666-45.269333z" p-id="5605" ></path>
</svg>
</i>
<b>4. </b>User Manual
</a>
<ul>
<li data-nav-id="/en/user-manual/elasticjob-lite/" title="ElasticJob-Lite" class="dd-item
parent
">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/">
<i class="collapse" style="display:inline; font-family:'courier';">
<svg class="icon icon-down"
style="display: inline-block;"
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#777">
<path d="M500.8 604.778667L267.306667 371.392l-45.226667 45.269333 278.741333 278.613334 278.485334-278.613334-45.248-45.248z" p-id="5376" ></path>
</svg>
<svg class="icon icon-right"
style="display: none;"
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#777">
<path d="M593.450667 512.128L360.064 278.613333l45.290667-45.226666 278.613333 278.762666L405.333333 790.613333l-45.226666-45.269333z" p-id="5605" ></path>
</svg>
</i>
<b>4.1. </b>ElasticJob-Lite
</a>
<ul>
<li data-nav-id="/en/user-manual/elasticjob-lite/usage/" title="Usage" class="dd-item
parent
">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/usage/">
<i class="collapse" style="display:inline; font-family:'courier';">
<svg class="icon icon-down"
style="display: inline-block;"
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#777">
<path d="M500.8 604.778667L267.306667 371.392l-45.226667 45.269333 278.741333 278.613334 278.485334-278.613334-45.248-45.248z" p-id="5376" ></path>
</svg>
<svg class="icon icon-right"
style="display: none;"
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#777">
<path d="M593.450667 512.128L360.064 278.613333l45.290667-45.226666 278.613333 278.762666L405.333333 790.613333l-45.226666-45.269333z" p-id="5605" ></path>
</svg>
</i>
<b>4.1.1 </b>Usage
</a>
<ul>
<li data-nav-id="/en/user-manual/elasticjob-lite/usage/job-api/" title="Job API" class="dd-item
parent
">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/usage/job-api/">
<i class="collapse" style="display:inline; font-family:'courier';">
<svg class="icon icon-down"
style="display: inline-block;"
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#777">
<path d="M500.8 604.778667L267.306667 371.392l-45.226667 45.269333 278.741333 278.613334 278.485334-278.613334-45.248-45.248z" p-id="5376" ></path>
</svg>
<svg class="icon icon-right"
style="display: none;"
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#777">
<path d="M593.450667 512.128L360.064 278.613333l45.290667-45.226666 278.613333 278.762666L405.333333 790.613333l-45.226666-45.269333z" p-id="5605" ></path>
</svg>
</i>
Job API
</a>
<ul>
<li data-nav-id="/en/user-manual/elasticjob-lite/usage/job-api/job-interface/" title="Job Development" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/usage/job-api/job-interface/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
Job Development
</a>
</li>
<li data-nav-id="/en/user-manual/elasticjob-lite/usage/job-api/java-api/" title="Use Java API" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/usage/job-api/java-api/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
Use Java API
</a>
</li>
<li data-nav-id="/en/user-manual/elasticjob-lite/usage/job-api/spring-boot-starter/" title="Use Spring Boot Starter" class="dd-item active">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/usage/job-api/spring-boot-starter/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
Use Spring Boot Starter
</a>
</li>
<li data-nav-id="/en/user-manual/elasticjob-lite/usage/job-api/spring-namespace/" title="Use Spring Namespace" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/usage/job-api/spring-namespace/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
Use Spring Namespace
</a>
</li>
</ul>
</li>
<li data-nav-id="/en/user-manual/elasticjob-lite/usage/job-listener/" title="Job Listener" class="dd-item
">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/usage/job-listener/">
<i class="collapse" style="display:inline; font-family:'courier';">
<svg class="icon icon-down"
style="display: none;"
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#777">
<path d="M500.8 604.778667L267.306667 371.392l-45.226667 45.269333 278.741333 278.613334 278.485334-278.613334-45.248-45.248z" p-id="5376" ></path>
</svg>
<svg class="icon icon-right"
style="display: inline-block;"
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#777">
<path d="M593.450667 512.128L360.064 278.613333l45.290667-45.226666 278.613333 278.762666L405.333333 790.613333l-45.226666-45.269333z" p-id="5605" ></path>
</svg>
</i>
Job Listener
</a>
<ul>
<li data-nav-id="/en/user-manual/elasticjob-lite/usage/job-listener/listener-interface/" title="Listener Development" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/usage/job-listener/listener-interface/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
Listener Development
</a>
</li>
<li data-nav-id="/en/user-manual/elasticjob-lite/usage/job-listener/java-api/" title="Use Java API" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/usage/job-listener/java-api/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
Use Java API
</a>
</li>
<li data-nav-id="/en/user-manual/elasticjob-lite/usage/job-listener/spring-namespace/" title="Use Spring Namespace" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/usage/job-listener/spring-namespace/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
Use Spring Namespace
</a>
</li>
</ul>
</li>
<li data-nav-id="/en/user-manual/elasticjob-lite/usage/tracing/" title="Tracing" class="dd-item
">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/usage/tracing/">
<i class="collapse" style="display:inline; font-family:'courier';">
<svg class="icon icon-down"
style="display: none;"
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#777">
<path d="M500.8 604.778667L267.306667 371.392l-45.226667 45.269333 278.741333 278.613334 278.485334-278.613334-45.248-45.248z" p-id="5376" ></path>
</svg>
<svg class="icon icon-right"
style="display: inline-block;"
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#777">
<path d="M593.450667 512.128L360.064 278.613333l45.290667-45.226666 278.613333 278.762666L405.333333 790.613333l-45.226666-45.269333z" p-id="5605" ></path>
</svg>
</i>
Tracing
</a>
<ul>
<li data-nav-id="/en/user-manual/elasticjob-lite/usage/tracing/java-api/" title="Use Java API" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/usage/tracing/java-api/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
Use Java API
</a>
</li>
<li data-nav-id="/en/user-manual/elasticjob-lite/usage/tracing/spring-boot-starter/" title="Use Spring Boot Starter" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/usage/tracing/spring-boot-starter/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
Use Spring Boot Starter
</a>
</li>
<li data-nav-id="/en/user-manual/elasticjob-lite/usage/tracing/spring-namespace/" title="Use Spring Namespace" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/usage/tracing/spring-namespace/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
Use Spring Namespace
</a>
</li>
<li data-nav-id="/en/user-manual/elasticjob-lite/usage/tracing/table-structure/" title="Table Structure" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/usage/tracing/table-structure/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
Table Structure
</a>
</li>
</ul>
</li>
<li data-nav-id="/en/user-manual/elasticjob-lite/usage/operation-api/" title="Operation API" class="dd-item
">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/usage/operation-api/">
<i class="collapse" style="display:inline; font-family:'courier';">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
</i>
Operation API
</a>
</li>
</ul>
</li>
<li data-nav-id="/en/user-manual/elasticjob-lite/configuration/" title="Configuration" class="dd-item
">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/configuration/">
<i class="collapse" style="display:inline; font-family:'courier';">
<svg class="icon icon-down"
style="display: none;"
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#777">
<path d="M500.8 604.778667L267.306667 371.392l-45.226667 45.269333 278.741333 278.613334 278.485334-278.613334-45.248-45.248z" p-id="5376" ></path>
</svg>
<svg class="icon icon-right"
style="display: inline-block;"
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#777">
<path d="M593.450667 512.128L360.064 278.613333l45.290667-45.226666 278.613333 278.762666L405.333333 790.613333l-45.226666-45.269333z" p-id="5605" ></path>
</svg>
</i>
<b>4.1.2 </b>Configuration
</a>
<ul>
<li data-nav-id="/en/user-manual/elasticjob-lite/configuration/java-api/" title="Java API" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/configuration/java-api/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
Java API
</a>
</li>
<li data-nav-id="/en/user-manual/elasticjob-lite/configuration/spring-boot-starter/" title="Spring Boot Starter" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/configuration/spring-boot-starter/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
Spring Boot Starter
</a>
</li>
<li data-nav-id="/en/user-manual/elasticjob-lite/configuration/spring-namespace/" title="Spring Namespace" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/configuration/spring-namespace/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
Spring Namespace
</a>
</li>
<li data-nav-id="/en/user-manual/elasticjob-lite/configuration/built-in-strategy/" title="Built-in Strategy" class="dd-item
">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/configuration/built-in-strategy/">
<i class="collapse" style="display:inline; font-family:'courier';">
<svg class="icon icon-down"
style="display: none;"
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#777">
<path d="M500.8 604.778667L267.306667 371.392l-45.226667 45.269333 278.741333 278.613334 278.485334-278.613334-45.248-45.248z" p-id="5376" ></path>
</svg>
<svg class="icon icon-right"
style="display: inline-block;"
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#777">
<path d="M593.450667 512.128L360.064 278.613333l45.290667-45.226666 278.613333 278.762666L405.333333 790.613333l-45.226666-45.269333z" p-id="5605" ></path>
</svg>
</i>
Built-in Strategy
</a>
<ul>
<li data-nav-id="/en/user-manual/elasticjob-lite/configuration/built-in-strategy/sharding/" title="Job Sharding Strategy" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/configuration/built-in-strategy/sharding/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
Job Sharding Strategy
</a>
</li>
<li data-nav-id="/en/user-manual/elasticjob-lite/configuration/built-in-strategy/thread-pool/" title="Thread Pool Strategy" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/configuration/built-in-strategy/thread-pool/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
Thread Pool Strategy
</a>
</li>
<li data-nav-id="/en/user-manual/elasticjob-lite/configuration/built-in-strategy/error-handler/" title="Error Handler Strategy" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/configuration/built-in-strategy/error-handler/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
Error Handler Strategy
</a>
</li>
</ul>
</li>
<li data-nav-id="/en/user-manual/elasticjob-lite/configuration/props/" title="Job Properties" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/configuration/props/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
Job Properties
</a>
</li>
</ul>
</li>
<li data-nav-id="/en/user-manual/elasticjob-lite/operation/" title="Operation" class="dd-item
">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/operation/">
<i class="collapse" style="display:inline; font-family:'courier';">
<svg class="icon icon-down"
style="display: none;"
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#777">
<path d="M500.8 604.778667L267.306667 371.392l-45.226667 45.269333 278.741333 278.613334 278.485334-278.613334-45.248-45.248z" p-id="5376" ></path>
</svg>
<svg class="icon icon-right"
style="display: inline-block;"
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#777">
<path d="M593.450667 512.128L360.064 278.613333l45.290667-45.226666 278.613333 278.762666L405.333333 790.613333l-45.226666-45.269333z" p-id="5605" ></path>
</svg>
</i>
<b>4.1.3 </b>Operation
</a>
<ul>
<li data-nav-id="/en/user-manual/elasticjob-lite/operation/deploy-guide/" title="Deploy Guide" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/operation/deploy-guide/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
Deploy Guide
</a>
</li>
<li data-nav-id="/en/user-manual/elasticjob-lite/operation/dump/" title="Dump Job Information" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/operation/dump/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
Dump Job Information
</a>
</li>
<li data-nav-id="/en/user-manual/elasticjob-lite/operation/execution-monitor/" title="Execution Monitor" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/operation/execution-monitor/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
Execution Monitor
</a>
</li>
<li data-nav-id="/en/user-manual/elasticjob-lite/operation/web-console/" title="Console" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/operation/web-console/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
Console
</a>
</li>
</ul>
</li>
</ul>
</li>
<li data-nav-id="/en/user-manual/elasticjob-cloud/" title="ElasticJob-Cloud" class="dd-item
">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-cloud/">
<i class="collapse" style="display:inline; font-family:'courier';">
<svg class="icon icon-down"
style="display: none;"
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#777">
<path d="M500.8 604.778667L267.306667 371.392l-45.226667 45.269333 278.741333 278.613334 278.485334-278.613334-45.248-45.248z" p-id="5376" ></path>
</svg>
<svg class="icon icon-right"
style="display: inline-block;"
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#777">
<path d="M593.450667 512.128L360.064 278.613333l45.290667-45.226666 278.613333 278.762666L405.333333 790.613333l-45.226666-45.269333z" p-id="5605" ></path>
</svg>
</i>
<b>4.2. </b>ElasticJob-Cloud
</a>
<ul>
<li data-nav-id="/en/user-manual/elasticjob-cloud/usage/" title="Usage" class="dd-item
">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-cloud/usage/">
<i class="collapse" style="display:inline; font-family:'courier';">
<svg class="icon icon-down"
style="display: none;"
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#777">
<path d="M500.8 604.778667L267.306667 371.392l-45.226667 45.269333 278.741333 278.613334 278.485334-278.613334-45.248-45.248z" p-id="5376" ></path>
</svg>
<svg class="icon icon-right"
style="display: inline-block;"
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#777">
<path d="M593.450667 512.128L360.064 278.613333l45.290667-45.226666 278.613333 278.762666L405.333333 790.613333l-45.226666-45.269333z" p-id="5605" ></path>
</svg>
</i>
<b>4.2.1. </b>Usage
</a>
<ul>
<li data-nav-id="/en/user-manual/elasticjob-cloud/usage/dev-guide/" title="Dev Guide" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-cloud/usage/dev-guide/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
Dev Guide
</a>
</li>
<li data-nav-id="/en/user-manual/elasticjob-cloud/usage/local-executor/" title="Local Executor" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-cloud/usage/local-executor/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
Local Executor
</a>
</li>
</ul>
</li>
<li data-nav-id="/en/user-manual/elasticjob-cloud/configuration/" title="Configuration" class="dd-item
">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-cloud/configuration/">
<i class="collapse" style="display:inline; font-family:'courier';">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
</i>
<b>4.2.2. </b>Configuration
</a>
</li>
<li data-nav-id="/en/user-manual/elasticjob-cloud/operation/" title="Operation" class="dd-item
">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-cloud/operation/">
<i class="collapse" style="display:inline; font-family:'courier';">
<svg class="icon icon-down"
style="display: none;"
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#777">
<path d="M500.8 604.778667L267.306667 371.392l-45.226667 45.269333 278.741333 278.613334 278.485334-278.613334-45.248-45.248z" p-id="5376" ></path>
</svg>
<svg class="icon icon-right"
style="display: inline-block;"
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#777">
<path d="M593.450667 512.128L360.064 278.613333l45.290667-45.226666 278.613333 278.762666L405.333333 790.613333l-45.226666-45.269333z" p-id="5605" ></path>
</svg>
</i>
<b>4.2.3. </b>Operation
</a>
<ul>
<li data-nav-id="/en/user-manual/elasticjob-cloud/operation/deploy-guide/" title="Deploy Guide" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-cloud/operation/deploy-guide/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
Deploy Guide
</a>
</li>
<li data-nav-id="/en/user-manual/elasticjob-cloud/operation/high-availability/" title="High Available" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-cloud/operation/high-availability/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
High Available
</a>
</li>
<li data-nav-id="/en/user-manual/elasticjob-cloud/operation/web-console/" title="Console" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-cloud/operation/web-console/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
Console
</a>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li data-nav-id="/en/dev-manual/" title="Dev Manual" class="dd-item
">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/dev-manual/">
<i class="collapse" style="display:inline; font-family:'courier';">
<svg class="icon icon-down"
style="display: none;"
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#777">
<path d="M500.8 604.778667L267.306667 371.392l-45.226667 45.269333 278.741333 278.613334 278.485334-278.613334-45.248-45.248z" p-id="5376" ></path>
</svg>
<svg class="icon icon-right"
style="display: inline-block;"
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#777">
<path d="M593.450667 512.128L360.064 278.613333l45.290667-45.226666 278.613333 278.762666L405.333333 790.613333l-45.226666-45.269333z" p-id="5605" ></path>
</svg>
</i>
<b>5. </b>Dev Manual
</a>
<ul>
<li data-nav-id="/en/dev-manual/sharding/" title="Job Sharding Strategy" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/dev-manual/sharding/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
<b>5.1. </b>Job Sharding Strategy
</a>
</li>
<li data-nav-id="/en/dev-manual/thread-pool/" title="Thread Pool Strategy" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/dev-manual/thread-pool/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
<b>5.2. </b>Thread Pool Strategy
</a>
</li>
<li data-nav-id="/en/dev-manual/error-handler/" title="Error Handler" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/dev-manual/error-handler/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
<b>5.3. </b>Error Handler
</a>
</li>
<li data-nav-id="/en/dev-manual/job-class-provider/" title="Job Class Name Provider" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/dev-manual/job-class-provider/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
<b>5.4. </b>Job Class Name Provider
</a>
</li>
<li data-nav-id="/en/dev-manual/roadmap/" title="Roadmap" class="dd-item ">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/dev-manual/roadmap/">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
<b>5.5. </b>Roadmap
</a>
</li>
</ul>
</li>
<li data-nav-id="/en/downloads/" title="Downloads" class="dd-item
">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/downloads/">
<i class="collapse" style="display:inline; font-family:'courier';">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
</i>
<b>6. </b>Downloads
</a>
</li>
<li data-nav-id="/en/powered-by/" title="Powered By" class="dd-item
">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/powered-by/">
<i class="collapse" style="display:inline; font-family:'courier';">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
</i>
<b>7. </b>Powered By
</a>
</li>
<li data-nav-id="/en/faq/" title="FAQ" class="dd-item
">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/faq/">
<i class="collapse" style="display:inline; font-family:'courier';">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
</i>
<b>8. </b>FAQ
</a>
</li>
<li data-nav-id="/en/blog/" title="Blog" class="dd-item
">
<a href="https://shardingsphere.apache.org/elasticjob/current/en/blog/">
<i class="collapse" style="display:inline; font-family:'courier';">
<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5375" width="20" height="20"></svg>
</i>
<b>9. </b>Blog
</a>
</li>
</ul>
<section id="prefooter">
<hr/>
<ul>
<li>
<a class="padding">
<i class="fa fa-fw fa-language"></i>
<div class="select-style">
<select id="select-language" onchange="location = this.value;">
<option id="en" value="/elasticjob/current/en/user-manual/elasticjob-lite/usage/job-api/spring-boot-starter/" selected>English</option>
<option id="cn" value="/elasticjob/current/cn/user-manual/elasticjob-lite/usage/job-api/spring-boot-starter/">简体中文</option>
</select>
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="255px" height="255px" viewBox="0 0 255 255" style="enable-background:new 0 0 255 255;" xml:space="preserve">
<g>
<g id="arrow-drop-down">
<polygon points="0,63.75 127.5,191.25 255,63.75 " />
</g>
</g>
</svg>
</div>
</a>
</li>
</ul>
</section>
<hr />
<a class="padding" href="https://shardingsphere.apache.org/pdf/shardingsphere-elasticjob_docs_en.pdf">
<i class="fa fa-fw fa-file-pdf-o" ></i>&nbsp;Download PDF&nbsp;&nbsp;
</a>
<section id="footer">
<p></p>
</section>
</div>
</nav>
<section id="body">
<div id="overlay"></div>
<div class="padding highlightable">
<div>
<div id="top-bar">
<div id="top-github-link">
<a class="github-link" title='Edit this page' href="https://github.com/apache/shardingsphere/tree/master/docs/document/content/user-manual/elasticjob-lite/usage/job-api/spring-boot-starter.en.md" target="blank">
<i class="fa fa-code-fork"></i>
<span id="top-github-link-text">Edit this page</span>
</a>
</div>
<div id="breadcrumbs" itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb">
<span id="sidebar-toggle-span">
<a href="#" id="sidebar-toggle" data-sidebar-toggle="">
<i class="fa fa-bars"></i>
</a>
</span>
<span class="links">
<a href='https://shardingsphere.apache.org/elasticjob/current/en/'>ElasticJob</a> > <a href='https://shardingsphere.apache.org/elasticjob/current/en/user-manual/'>User Manual</a> > <a href='https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/'>ElasticJob-Lite</a> > <a href='https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/usage/'>Usage</a> > <a href='https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/usage/job-api/'>Job API</a> > Use Spring Boot Starter
</span>
</div>
</div>
</div>
<div id="chapter">
<div id="body-inner">
<nav id="TableOfContents">
<ul>
<li><a href="#job-configuration">Job configuration</a>
<ul>
<li><a href="#implements-elasticjob">Implements ElasticJob</a></li>
<li><a href="#configure-coordinateregistrycenter-and-jobs">Configure CoordinateRegistryCenter and Jobs</a></li>
</ul>
</li>
<li><a href="#job-start">Job Start</a>
<ul>
<li><a href="#schedule-job">Schedule Job</a></li>
<li><a href="#one-off-job">One-off Job</a></li>
</ul>
</li>
</ul>
</nav>
<p>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.</p>
<h2 id="job-configuration">Job configuration</h2>
<h3 id="implements-elasticjob">Implements ElasticJob</h3>
<p>Job implementation is similar to other usage of ElasticJob.
The difference is that jobs will be registered into the Spring IoC container.</p>
<p><strong>Thread-Safety Issue</strong></p>
<p>Bean is singleton by default.
Consider setting Bean Scope to <code>prototype</code> if the instance of ElasticJob would be used by more than a JobBootstrap.</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-java" data-lang="java"><span style="color:#a6e22e">@Component</span>
<span style="color:#66d9ef">public</span> <span style="color:#66d9ef">class</span> <span style="color:#a6e22e">SpringBootDataflowJob</span> <span style="color:#66d9ef">implements</span> DataflowJob<span style="color:#f92672">&lt;</span>Foo<span style="color:#f92672">&gt;</span> <span style="color:#f92672">{</span>
<span style="color:#a6e22e">@Override</span>
<span style="color:#66d9ef">public</span> List<span style="color:#f92672">&lt;</span>Foo<span style="color:#f92672">&gt;</span> <span style="color:#a6e22e">fetchData</span><span style="color:#f92672">(</span><span style="color:#66d9ef">final</span> ShardingContext shardingContext<span style="color:#f92672">)</span> <span style="color:#f92672">{</span>
<span style="color:#75715e">// fetch data
</span><span style="color:#75715e"></span> <span style="color:#f92672">}</span>
<span style="color:#a6e22e">@Override</span>
<span style="color:#66d9ef">public</span> <span style="color:#66d9ef">void</span> <span style="color:#a6e22e">processData</span><span style="color:#f92672">(</span><span style="color:#66d9ef">final</span> ShardingContext shardingContext<span style="color:#f92672">,</span> <span style="color:#66d9ef">final</span> List<span style="color:#f92672">&lt;</span>Foo<span style="color:#f92672">&gt;</span> data<span style="color:#f92672">)</span> <span style="color:#f92672">{</span>
<span style="color:#75715e">// process data
</span><span style="color:#75715e"></span> <span style="color:#f92672">}</span>
<span style="color:#f92672">}</span>
</code></pre></div><h3 id="configure-coordinateregistrycenter-and-jobs">Configure CoordinateRegistryCenter and Jobs</h3>
<p>Configure the Zookeeper which will be used by ElasticJob via configuration files.</p>
<p><code>elasticjob.jobs</code> is a Map. Using key as job name. Specific job type and configuration in value.
The Starter will create instances of <code>OneOffJobBootstrap</code> or <code>ScheduleJobBootstrap</code> and register them into the Spring IoC container automatically.</p>
<p>Configuration reference:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yaml" data-lang="yaml"><span style="color:#66d9ef">elasticjob</span>:
<span style="color:#66d9ef">regCenter</span>:
<span style="color:#66d9ef">serverLists</span>: localhost:<span style="color:#ae81ff">6181</span>
<span style="color:#66d9ef">namespace</span>: elasticjob-lite-springboot
<span style="color:#66d9ef">jobs</span>:
<span style="color:#66d9ef">dataflowJob</span>:
<span style="color:#66d9ef">elasticJobClass</span>: org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob
<span style="color:#66d9ef">cron</span>: <span style="color:#ae81ff">0</span>/<span style="color:#ae81ff">5</span> * * * * ?
<span style="color:#66d9ef">shardingTotalCount</span>: <span style="color:#ae81ff">3</span>
<span style="color:#66d9ef">shardingItemParameters</span>: <span style="color:#ae81ff">0</span>=Beijing,<span style="color:#ae81ff">1</span>=Shanghai,<span style="color:#ae81ff">2</span>=Guangzhou
<span style="color:#66d9ef">scriptJob</span>:
<span style="color:#66d9ef">elasticJobType</span>: SCRIPT
<span style="color:#66d9ef">cron</span>: <span style="color:#ae81ff">0</span>/<span style="color:#ae81ff">10</span> * * * * ?
<span style="color:#66d9ef">shardingTotalCount</span>: <span style="color:#ae81ff">3</span>
<span style="color:#66d9ef">props</span>:
<span style="color:#66d9ef">script.command.line</span>: <span style="color:#e6db74">&#34;echo SCRIPT Job: &#34;</span>
</code></pre></div><h2 id="job-start">Job Start</h2>
<h3 id="schedule-job">Schedule Job</h3>
<p>Just start Spring Boot Starter directly. The schedule jobs will startup when the Spring Boot Application is started.</p>
<h3 id="one-off-job">One-off Job</h3>
<p>When to execute OneOffJob is up to you.
Developers can inject the <code>OneOffJobBootstrap</code> bean into where they plan to invoke.
Trigger the job by invoking <code>execute()</code> method manually.</p>
<p><strong>About @DependsOn Annotation</strong></p>
<p>JobBootstraps are created by the Starter dynamically. It&rsquo;s unable to inject the <code>JobBootstrap</code> beans if the beans which depends on <code>JobBootstrap</code> were instantiated earlier than the instantiation of <code>JobBootstrap</code>.</p>
<p>Developers can also retrieve <code>JobBootstrap</code> beans by ApplicationContext.</p>
<p>The bean name of <code>OneOffJobBootstrap</code> is specified by property &ldquo;jobBootstrapBeanName&rdquo;,
Please refer to <a href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/configuration/spring-boot-starter">Spring Boot Starter Configuration</a>.</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-java" data-lang="java"><span style="color:#a6e22e">@RestController</span>
<span style="color:#a6e22e">@DependsOn</span><span style="color:#f92672">(</span><span style="color:#e6db74">&#34;ElasticJobLiteAutoConfiguration&#34;</span><span style="color:#f92672">)</span>
<span style="color:#66d9ef">public</span> <span style="color:#66d9ef">class</span> <span style="color:#a6e22e">OneOffJobController</span> <span style="color:#f92672">{</span>
<span style="color:#a6e22e">@Resource</span><span style="color:#f92672">(</span>name <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;manualScriptJobOneOffJobBootstrap&#34;</span><span style="color:#f92672">)</span>
<span style="color:#66d9ef">private</span> OneOffJobBootstrap manualScriptJob<span style="color:#f92672">;</span>
<span style="color:#a6e22e">@GetMapping</span><span style="color:#f92672">(</span><span style="color:#e6db74">&#34;/execute&#34;</span><span style="color:#f92672">)</span>
<span style="color:#66d9ef">public</span> String <span style="color:#a6e22e">executeOneOffJob</span><span style="color:#f92672">()</span> <span style="color:#f92672">{</span>
manualScriptJob<span style="color:#f92672">.</span><span style="color:#a6e22e">execute</span><span style="color:#f92672">();</span>
<span style="color:#66d9ef">return</span> <span style="color:#e6db74">&#34;{\&#34;msg\&#34;:\&#34;OK\&#34;}&#34;</span><span style="color:#f92672">;</span>
<span style="color:#f92672">}</span>
<span style="color:#f92672">}</span>
</code></pre></div>
<footer class=" footline" >
</footer>
</div>
</div>
</div>
<div id="navigation">
<a class="nav nav-prev" href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/usage/job-api/java-api/" title="Use Java API"> <i class="fa fa-chevron-left"></i></a>
<a class="nav nav-next" href="https://shardingsphere.apache.org/elasticjob/current/en/user-manual/elasticjob-lite/usage/job-api/spring-namespace/" title="Use Spring Namespace" style="margin-right: 0px;"><i class="fa fa-chevron-right"></i></a>
</div>
</section>
<div style="left: -1000px; overflow: scroll; position: absolute; top: -1000px; border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;">
<div style="border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;"></div>
</div>
<script src="https://shardingsphere.apache.org/elasticjob/current/js/clipboard.min.js?1603112112"></script>
<script src="https://shardingsphere.apache.org/elasticjob/current/js/perfect-scrollbar.min.js?1603112112"></script>
<script src="https://shardingsphere.apache.org/elasticjob/current/js/perfect-scrollbar.jquery.min.js?1603112112"></script>
<script src="https://shardingsphere.apache.org/elasticjob/current/js/jquery.sticky.js?1603112112"></script>
<script src="https://shardingsphere.apache.org/elasticjob/current/js/featherlight.min.js?1603112112"></script>
<script src="https://shardingsphere.apache.org/elasticjob/current/js/html5shiv-printshiv.min.js?1603112112"></script>
<script src="https://shardingsphere.apache.org/elasticjob/current/js/highlight.pack.js?1603112112"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="https://shardingsphere.apache.org/elasticjob/current/js/modernizr.custom.71422.js?1603112112"></script>
<script src="https://shardingsphere.apache.org/elasticjob/current/js/learn.js?1603112112"></script>
<script src="https://shardingsphere.apache.org/elasticjob/current/js/hugo-learn.js?1603112112"></script>
</body>
</html>