All Projects → xxl-job → xxl-job-executor-go

xxl-job / xxl-job-executor-go

Licence: MIT license
xxl-job 执行器(golang 客户端)

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to xxl-job-executor-go

lambda-cron
LambdaCron - serverless cron tool
Stars: ✭ 22 (-92.62%)
Mutual labels:  crontab, cronjob
gronx
Lightweight, fast and dependency-free Cron expression parser (due checker), task scheduler and/or daemon for Golang (tested on v1.13 and above) and standalone usage
Stars: ✭ 206 (-30.87%)
Mutual labels:  crontab, cronjob
Ppgo job
PPGo_Job是一款可视化的、多人多权限的、一任务多机执行的定时任务管理系统,采用golang开发,安装方便,资源消耗少,支持大并发,可同时管理多台服务器上的定时任务。
Stars: ✭ 1,152 (+286.58%)
Mutual labels:  crontab
Cronv
A visualizer for CRONTAB
Stars: ✭ 196 (-34.23%)
Mutual labels:  crontab
Gophercron
golang 开箱即用的秒级分布式定时任务系统
Stars: ✭ 146 (-51.01%)
Mutual labels:  crontab
Cronmon
定时任务执行状态监控
Stars: ✭ 90 (-69.8%)
Mutual labels:  crontab
Firemotd
🔥 Fire Framework Linux MoTD Generator 🔥
Stars: ✭ 156 (-47.65%)
Mutual labels:  crontab
How To Mine Newsfeed Data And Extract Interactive Insights In Python
A practical guide to topic mining and interactive visualizations
Stars: ✭ 61 (-79.53%)
Mutual labels:  crontab
W7 Rangine Empty
软擎是基于 Php 7.2+ 和 Swoole 4.4+ 的高性能、简单易用的开发框架。支持同时在 Swoole Server 和 php-fpm 两种模式下运行。内置了 Http (Swoole, Fpm),Tcp,WebSocket,Process,Crontab服务。集成了大量成熟的组件,可以用于构建高性能的Web系统、API、中间件、基础服务等等。
Stars: ✭ 246 (-17.45%)
Mutual labels:  crontab
Quantum Core
⌚ Cron-like job scheduler for Elixir
Stars: ✭ 1,905 (+539.26%)
Mutual labels:  crontab
Cron Parser
Java Parser For Cron Expressions
Stars: ✭ 176 (-40.94%)
Mutual labels:  crontab
Go Quartz
Simple, zero-dependency scheduling library for Go
Stars: ✭ 118 (-60.4%)
Mutual labels:  crontab
Job
JOB, make your short-term command as a long-term job. 将命令行规划成任务的工具
Stars: ✭ 98 (-67.11%)
Mutual labels:  crontab
Docker Crontab
A docker job scheduler (aka. crontab for docker)
Stars: ✭ 159 (-46.64%)
Mutual labels:  crontab
Krontab
⏰ A crontab like editor for Kubernetes cron jobs
Stars: ✭ 90 (-69.8%)
Mutual labels:  crontab
Cronsun
A Distributed, Fault-Tolerant Cron-Style Job System.
Stars: ✭ 2,493 (+736.58%)
Mutual labels:  crontab
Crontab
Parse Cron Expressions, Compose Cron Expression Strings and Caluclate Execution Dates.
Stars: ✭ 62 (-79.19%)
Mutual labels:  crontab
Crontab Ui
Easy and safe way to manage your crontab file
Stars: ✭ 1,786 (+499.33%)
Mutual labels:  crontab
Ects
Elastic Crontab System 简单易用的分布式定时任务管理系统
Stars: ✭ 156 (-47.65%)
Mutual labels:  crontab
it-tools
A programing helper for developers built with Electron & Vue.js 🚀
Stars: ✭ 114 (-61.74%)
Mutual labels:  crontab

xxl-job-executor-go

很多公司java与go开发共存,java中有xxl-job做为任务调度引擎,为此也出现了go执行器(客户端),使用起来比较简单:

支持

1.执行器注册
2.耗时任务取消
3.任务注册,像写http.Handler一样方便
4.任务panic处理
5.阻塞策略处理
6.任务完成支持返回执行备注
7.任务超时取消 (单位:秒,0为不限制)
8.失败重试次数(在参数param中,目前由任务自行处理)
9.可自定义日志
10.自定义日志查看handler
11.支持外部路由(可与gin集成)

Example

package main

import (
	"fmt"
	xxl "github.com/xxl-job/xxl-job-executor-go"
	"github.com/xxl-job/xxl-job-executor-go/example/task"
	"log"
)

func main() {
	exec := xxl.NewExecutor(
		xxl.ServerAddr("http://127.0.0.1/xxl-job-admin"),
		xxl.AccessToken(""),            //请求令牌(默认为空)
		xxl.ExecutorIp("127.0.0.1"),    //可自动获取
		xxl.ExecutorPort("9999"),       //默认9999(非必填)
		xxl.RegistryKey("golang-jobs"), //执行器名称
		xxl.SetLogger(&logger{}),       //自定义日志
	)
	exec.Init()
	//设置日志查看handler
	exec.LogHandler(func(req *xxl.LogReq) *xxl.LogRes {
		return &xxl.LogRes{Code: xxl.SuccessCode, Msg: "", Content: xxl.LogResContent{
			FromLineNum: req.FromLineNum,
			ToLineNum:   2,
			LogContent:  "这个是自定义日志handler",
			IsEnd:       true,
		}}
	})
	//注册任务handler
	exec.RegTask("task.test", task.Test)
	exec.RegTask("task.test2", task.Test2)
	exec.RegTask("task.panic", task.Panic)
	log.Fatal(exec.Run())
}

//xxl.Logger接口实现
type logger struct{}

func (l *logger) Info(format string, a ...interface{}) {
	fmt.Println(fmt.Sprintf("自定义日志 - "+format, a...))
}

func (l *logger) Error(format string, a ...interface{}) {
	log.Println(fmt.Sprintf("自定义日志 - "+format, a...))
}

示例项目

github.com/xxl-job/xxl-job-executor-go/example/

与gin框架集成

https://github.com/gin-middleware/xxl-job-executor

xxl-job-admin配置

添加执行器

执行器管理->新增执行器,执行器列表如下:

AppName		名称		注册方式	OnLine 		机器地址 		操作
golang-jobs	golang执行器	自动注册 		查看 ( 1 )   

查看->注册节点

http://127.0.0.1:9999

添加任务

任务管理->新增(注意,使用BEAN模式,JobHandler与RegTask名称一致)

1	测试panic	BEAN:task.panic	* 0 * * * ?	admin	STOP	
2	测试耗时任务	BEAN:task.test2	* * * * * ?	admin	STOP	
3	测试golang	BEAN:task.test		* * * * * ?	admin	STOP
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].