Back to Shardingsphere Elasticjob

Spring Namespace.En

docs/content/user-manual/configuration/spring-namespace.en.md

3.0.53.6 KB
Original Source

+++ title = "Spring Namespace" weight = 2 chapter = true +++

To use the Spring namespace, user need to add the dependency of the elasticjob-spring module in the pom.xml file.

xml
<dependency>
    <groupId>org.apache.shardingsphere.elasticjob</groupId>
    <artifactId>elasticjob-spring-namespace</artifactId>
    <version>${latest.release.version}</version>
</dependency>

Spring namespace: http://shardingsphere.apache.org/schema/elasticjob/elasticjob.xsd

Registry Center Configuration

<elasticjob:zookeeper />

Configuration:

NameRequired
idYes
server-listsYes
namespaceYes
base-sleep-time-millisecondsNo
max-sleep-time-millisecondsNo
max-retriesNo
session-timeout-millisecondsNo
connection-timeout-millisecondsNo
digestNo

Job Configuration

<elasticjob:job />

Configuration:

NameRequired
idYes
classNo
job-refNo
registry-center-refYes
tracing-refNo
cronYes
timeZoneNo
sharding-total-countYes
sharding-item-parametersNo
job-parameterNo
monitor-executionNo
failoverNo
misfireNo
max-time-diff-secondsNo
reconcile-interval-minutesNo
job-sharding-strategy-typeNo
job-executor-service-handler-typeNo
job-error-handler-typeNo
descriptionNo
propsNo
disabledNo
overwriteNo

Event Tracing Configuration

<elasticjob:rdb-tracing />

Configuration:

NameData TypeRequiredDefault ValueDescription
idStringYesThe bean's identify of the event tracing
data-source-refDataSourceNoThe bean's name of the event tracing DataSource

Job Dump Configuration

<elasticjob:snapshot />

Configuration:

NameData TypeRequiredDefault ValueDescription
idStringYesThe identify of the monitoring service in the Spring container
registry-center-refStringYesRegistry center bean's reference, need to the statement of the reg:zookeeper
dump-portStringYesJob dump port
usage: echo "dump@jobName" | nc 127.0.0.1 9888