作业配置

Spring容器配合使用作业,可以将作业Bean配置为Spring Bean,可在作业中通过依赖注入使用Spring容器管理的数据源等对象。可用placeholder占位符从属性文件中取值。

Spring命名空间配置

<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright - Alibaba Group.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:job="http://www.dangdang.com/schema/ddframe/job"
xsi:schemaLocation="http://www.dangdang.com/schema/ddframe/job http://www.dangdang.com/schema/ddframe/job/job.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.1.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.3.xsd"> <job:simple id="virtualInstanceChargeJobTrigger" job-ref="virtualInstanceChargeJob" registry-center-ref="zookeeperRegistryCenter" cron="*/30 * * * * ?" sharding-total-count="" />
</beans>

job:simple命名空间属性详细说明

属性名 类型 是否必填 缺省值 描述
id String   作业名称
class String   作业实现类,需实现ElasticJob接口,脚本型作业不需要配置
registry-center-ref String   注册中心Bean的引用,需引用reg:zookeeper的声明
cron String   cron表达式,用于配置作业触发时间
sharding-total-count int   作业分片总数
sharding-item-parameters String   分片序列号和参数用等号分隔,多个键值对用逗号分隔
分片序列号从0开始,不可大于或等于作业分片总数
如:
0=a,1=b,2=c
job-parameter String   作业自定义参数
可以配置多个相同的作业,但是用不同的参数作为不同的调度实例
monitor-execution boolean true 监控作业运行时状态
每次作业执行时间和间隔时间均非常短的情况,建议不监控作业运行时状态以提升效率。因为是瞬时状态,所以无必要监控。请用户自行增加数据堆积监控。并且不能保证数据重复选取,应在作业中实现幂等性。
每次作业执行时间和间隔时间均较长的情况,建议监控作业运行时状态,可保证数据不会重复选取。
monitor-port int -1 作业监控端口
建议配置作业监控端口, 方便开发者dump作业信息。
使用方法: echo “dump” | nc 127.0.0.1 9888
max-time-diff-seconds int -1 最大允许的本机与注册中心的时间误差秒数
如果时间误差超过配置秒数则作业启动时将抛异常
配置为-1表示不校验时间误差
failover boolean false 是否开启失效转移
monitorExecution开启,失效转移才有效
misfire boolean true 是否开启错过任务重新执行
job-sharding-strategy-class String true 作业分片策略实现类全路径
默认使用平均分配策略
详情参见:作业分片策略
description String   作业描述信息
disabled boolean false 作业是否禁止启动
可用于部署作业时,先禁止启动,部署结束后统一启动
overwrite boolean false 本地配置是否可覆盖注册中心配置
如果可覆盖,每次启动作业都以本地配置为准

Elastic-Job 配置介绍的更多相关文章

  1. 什么是blob,mysql blob大小配置介绍

    什么是blob,mysql blob大小配置介绍 作者: 字体:[增加 减小] 类型:转载   BLOB (binary large object),二进制大对象,是一个可以存储二进制文件的容器.在计 ...

  2. ecshop 工作流程加载配置介绍

    ecshop 工作流程加载配置介绍 分类: ecshop2014-09-14 09:36 729人阅读 评论(2) 收藏 举报 模板引擎工作流 这里简单介绍下echsop工作流程: 首先,你会发现一般 ...

  3. Window VNC远程控制LINUX:VNC详细配置介绍

    Window VNC远程控制LINUX:VNC详细配置介绍 //---------------------------------------vnc linux下的详细配置 1.VNC的启动/停止/重 ...

  4. ASP.NET Core 运行原理解剖[2]:Hosting补充之配置介绍

    在上一章中,我们介绍了 ASP.NET Core 的启动过程,主要是对 WebHost 源码的探索.而本文则是对上文的一个补充,更加偏向于实战,详细的介绍一下我们在实际开发中需要对 Hosting 做 ...

  5. Elastic Stack-Elasticsearch使用介绍(五)

    一.前言     前4篇将Elasticsearch用法的API和原理方面东西介绍了一下,相信大家对Elasticsearch有了一定的认知,接下我们主要从索引的建立到后期的一些优化做一些介绍: 二. ...

  6. prometheus 配置介绍

    prometheus 配置介绍 prometheus 配置分global.alerting.rule_files.scrape_configs 1.global(全局配置) scrape_interv ...

  7. Centos 7 磁盘阵列配置介绍(RAID)

    转自:https://blog.51cto.com/gaowenlong/2086918 Centos 7 磁盘阵列配置介绍每当我们提到磁盘阵列,相信广大管理员并不陌生,比如我们一般安装服务器系统的时 ...

  8. LINUX服务器搭建和常用配置介绍

    服务器搭建 : 搭建私有CA服务器 : http://www.cnblogs.com/zhaojiedi1992/p/zhaojiedi_linux_011_ca.html搭建samba服务器 : h ...

  9. Nginx 日志格式配置介绍

    Nginx日志格式配置介绍   by:授客  QQ:1033553122   测试环境 CentOS 6.5-x86_64 nginx-1.10.0 配置例子 log_format  main  '$ ...

  10. Tsung MQTT协议简介及MQTT xml文档配置介绍

    MQTT协议简介及MQTT xml文档配置介绍 by:授客 QQ:1033553122 1. MQTT协议介绍 MQTT(Message Queuing Telemetry Transport,消息队 ...

随机推荐

  1. css3 属性

    1.css 面试题: css 组成: css 样式组成 规则:选择器+声明块 声明块:css属性+css属性值 2.css 解析规则: 从右往左 3.文字超出省略号显示: 1.元素不是内联块 2.ov ...

  2. nodejs----微信注册测试号获取token

    var PORT=8081; //监听8080端口号 var http=require('http'); var qs=require('qs'); var TOKEN='yezhenxu'; //必 ...

  3. bootstrap-treeview分级展示列表树的实现

    html页面: 要引用 "/webapp/common/css/bootstrap-treeview.css" "/webapp/common/js/bootstrap- ...

  4. Gym 101606B - Breaking Biscuits - [凸包+旋转卡壳][凸包的宽度]

    题目链接:https://codeforces.com/gym/101606/problem/B 题解: 对于给出的 $n$ 个点,先求这些点的凸包,然后用旋转卡壳求出凸包的宽度(Width (min ...

  5. RobotFramework环境配置:默认以管理员权限运行cmd

    设置cmd以管理员权限运行 目的:创建或删除文件等命令时,需要管理员权限运行cmd(linux以root用户登录).   例如,创建日志目录.   方法一: 1.激活administrator用户 2 ...

  6. 【Python基础】lpthw - Exercise 37 复习各种符号

    本节需要熟悉python的符号和关键字的功能. 一.关键字 1. and 逻辑与,如 True and False == False的值为True 2. as with...as...的功能类似try ...

  7. FPGA验证之SystemVerilog+UVM

    [转载]https://blog.csdn.net/lijiuyangzilsc/article/details/50879545     数字芯片和FPGA的验证.主要是其中的功能仿真和时序仿真. ...

  8. Linux unalias命令 取消别名

    unalias 提示:命令行处理别名仅为临时取消别名,重启系统后就失效了 [root@MongoDB ~]# alias |grep cp alias cp='cp -i' [root@MongoDB ...

  9. Java面试题和解答(三)

    1.这段代码大多数情况下运行正常,但是某些情况下会出问题.什么时候会出现什么问题?如何修正? public class MyStack { private List<String> lis ...

  10. group by分组后获得每组中符合条件的那条记录

    当group by单独使用时,只显示出每组的第一条记录.如下,未分组时查询出两条记录 SELECT info.id, info.switch_id, info.port_id, info.mac_ad ...