Skip to content
集群任务调度中心
Java HTML CSS Other
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.mvn/wrapper
common
console
core/src/main/java/com/leaf/jobs
db
jobs-server
quartz-support
test
.gitattributes
.gitignore
README.md
pom.xml

README.md

leaf-jobs

一个简单的任务调度中心

  • rpc模块 netty
  • quartz-support模块 quartz集群模式
  • console模块 springboot控制台
  • jobs-starter模块 服务端需要依赖
  • test模块 spi的test模块

数据库脚本

  • leaf-jobs/db/customer.sql
  • leaf-jobs/db/tables_mysql_innodb.sql

服务端配置

可参考test模块

依赖

    <dependency>
        <groupId>com.leaf.jobs</groupId>
        <artifactId>jobs-spring-boot-starter</artifactId>
        <version>0.0.1-SNAPSHOT</version>
    </dependency>

支持springboot autoconfig

@SpringBootApplication
@JobsScanner(basePackages = "com.leaf.jobs")
public class SpiApplication {

    public static void main(String[] args) {
        SpringApplication.run(SpiApplication.class, args);
    }
}

public interface HelloService {

    String sayHello(String name);

    String sayHello2(String name, String age);
}

@JobsProvider(group = "rjb")
@Slf4j
public class HelloServiceImpl implements HelloService {

    @Override
    public String sayHello(String name) {
        log.info("hi service" + name);
        return "ss: " + name;
    }

    @Override
    public String sayHello2(String name, String age) {
        log.info("hi service" + name);
        return "ss: " + name + age;
    }
}
    leaf:
        jobs:
          registerAddress: 172.16.2.203:2181
          systemName: rjb
          port: 9000
          script: true //支持推送shell脚本等执行

调度中心控制台

启动 com.leaf.jobs.JobsApplication 即可

后续

  • 日志回显优化
  • 脚本 groovy 执行
  • 子任务
You can’t perform that action at this time.