GithubHelp home page GithubHelp logo

zjpjohn / cloudschedule Goto Github PK

View Code? Open in Web Editor NEW
14.0 5.0 7.0 5.1 MB

分布式调度系统,基于zookeeper ,netty,调度内核参考Spring schedule 执行表达式和Spring schedule一样,没有使用Quartz,客户端完全基于注解配置,使用同 Spring schedule一致,最少配置,使用简单

Java 5.05% CSS 19.04% JavaScript 73.98% HTML 1.93%
distribute schedule netty zookeeper spring springboot

cloudschedule's Introduction

CloudSchedule

分布式调度系统,基于zookeeper ,netty,调度内核参考Spring schedule 执行表达式和Spring schedule一样,没有使用Quartz,客户端完全基于注解配置,使用同 Spring schedule一致,最少配置,使用简单

客户端使用只需作如下配置: 1.启用该调度器

@Configuration

@EnableQSchedule

public class ScheduleConfig {

@Resource
private Environment env;

@Bean
public QScheduleProperties qScheduleProperties() {
    QScheduleProperties properties = new QScheduleProperties();
    properties.setAppName(env.getProperty("schedule.appName"));
    properties.setEnv(env.getProperty("schedule.env"));
    properties.setNameSpace(env.getProperty("schedule.nameSpace"));
    properties.setPort(Integer.valueOf(env.getProperty("schedule.port")));
    properties.setUrl(env.getProperty("schedule.url"));
    return properties;
}

}

2.使用注解进行定时任务操作

@QSchedule()

public class ScheduleClientDemo {

@Schedule(cron = "*/10 * * * * ?")
public void schedule1() {
    System.out.println("测试用例1");
}

@Schedule(cron = "*/10 * * * * ?", value = "test2")
public void schedule2() {
    System.out.println("测试用例2");
}

}

server端主要是进行管理和任务调度

image image image

后续版本将主要做两方面:

1.引入leader选举,调度器进行无线扩容,对定时任务的调用进行负载均衡,平滑的在不同调度器上运行

2.调度器进行优化,是定时任务执行更高效

cloudschedule's People

Contributors

zjpjohn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.