heanbian-elasticjob

Heanbian elasticjob component.

License

License

GroupId

GroupId

com.heanbian.block
ArtifactId

ArtifactId

heanbian-elasticjob
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

heanbian-elasticjob
Heanbian elasticjob component.
Project URL

Project URL

https://github.com/heanbian/heanbian-elasticjob
Source Code Management

Source Code Management

https://github.com/heanbian/heanbian-elasticjob

Download heanbian-elasticjob

How to add to project

<!-- https://jarcasting.com/artifacts/com.heanbian.block/heanbian-elasticjob/ -->
<dependency>
    <groupId>com.heanbian.block</groupId>
    <artifactId>heanbian-elasticjob</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.heanbian.block/heanbian-elasticjob/
implementation 'com.heanbian.block:heanbian-elasticjob:1.0.1'
// https://jarcasting.com/artifacts/com.heanbian.block/heanbian-elasticjob/
implementation ("com.heanbian.block:heanbian-elasticjob:1.0.1")
'com.heanbian.block:heanbian-elasticjob:jar:1.0.1'
<dependency org="com.heanbian.block" name="heanbian-elasticjob" rev="1.0.1">
  <artifact name="heanbian-elasticjob" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.heanbian.block', module='heanbian-elasticjob', version='1.0.1')
)
libraryDependencies += "com.heanbian.block" % "heanbian-elasticjob" % "1.0.1"
[com.heanbian.block/heanbian-elasticjob "1.0.1"]

Dependencies

compile (3)

Group / Artifact Type Version
com.dangdang : elastic-job-lite-spring jar 2.1.5
org.springframework.boot : spring-boot-autoconfigure jar 2.4.2
org.springframework.boot : spring-boot-configuration-processor jar 2.4.2

Project Modules

There are no modules declared in this project.

heanbian-elasticjob

前提条件

JDK11+

pom.xml

具体版本,可以上Maven中央仓库查询

<dependency>
  <groupId>com.heanbian.block</groupId>
  <artifactId>heanbian-elasticjob</artifactId>
  <version>1.0.1</version>
</dependency>

使用示例

配置 application.yml

heanbian:
  elasticjob:
    zookeeper-nodes: 192.168.1.101:2181,192.168.1.102:2181,192.168.1.103:2181
    zookeeper-namespace: elasticjob_fgFDGdfg45435SDFsfb #自定义

Spring Boot 启动类添加注解:

@EnableElasticJob

Java代码片段:

@Component
@ElasticJobClient(cron = "*/10 * * * * ?")
public class TestTask implements SimpleJob {

	@Override
	public void execute(ShardingContext shardingContext) {

	}
}

说明:适用于 Spring Boot 项目。

Versions

Version
1.0.1
1.0.0