🔥 Removing code or files. 删除 elastic-job

This commit is contained in:
冷冷 committed 2020-03-24 17:22:12 +08:00
1 parent 53700d6f63
commit fd3326602b
29 files changed
+5 -1575

No files matched your search

+1 -8
View File
@@ -332,11 +332,7 @@ INSERT INTO `sys_menu` VALUES (3200, '接口文档', NULL, 'http://127.0.0.1:999
INSERT INTO `sys_menu` VALUES (3300, '事务监控', NULL, '/tx/index', 3000, 'icon-gtsquanjushiwufuwuGTS', 5, '0', '0', '2018-08-19 11:02:39', '2019-06-24 15:18:04', '0');
INSERT INTO `sys_menu` VALUES (3400, '在线事务', NULL, '/tx/model', 3000, 'icon-online', 6, '0', '0', '2018-08-19 11:32:04', '2019-06-24 15:18:13', '0');
INSERT INTO `sys_menu` VALUES (3500, '文档扩展', NULL, 'http://127.0.0.1:9999/doc.html', 3000, 'icon-wendang', 2, '0', '0', '2018-06-26 10:50:32', '2019-05-01 23:57:42', '0');
INSERT INTO `sys_menu` VALUES (3600, '任务轨迹', '', '/daemon/status-trace-log/index', 3000, 'icon-guiji', 8, '0', '0', '2018-01-20 13:17:19', '2019-06-24 15:18:41', '0');
INSERT INTO `sys_menu` VALUES (3601, '删除轨迹', 'daemon_status_trace_log_del', NULL, 3600, '1', 2, '0', '1', '2018-05-15 21:35:18', '2019-03-30 09:31:06', '0');
INSERT INTO `sys_menu` VALUES (3620, 'Quartz日志', '', '/daemon/job-log/index', 3000, 'icon-gtsquanjushiwufuwuGTS', 8, '0', '0', '2018-01-20 13:17:19', '2019-06-24 15:18:54', '0');
INSERT INTO `sys_menu` VALUES (3630, '任务日志', '', '/daemon/execution-log/index', 3000, 'icon-wendang', 7, '0', '0', '2018-01-20 13:17:19', '2019-06-24 15:19:07', '0');
INSERT INTO `sys_menu` VALUES (3631, '删除日志', 'daemon_execution_log_del', NULL, 3900, '1', 2, '0', '1', '2018-05-15 21:35:18', '2019-03-30 09:30:45', '0');
INSERT INTO `sys_menu` VALUES (3600, 'Quartz日志', '', '/daemon/job-log/index', 3000, 'icon-gtsquanjushiwufuwuGTS', 8, '0', '0', '2018-01-20 13:17:19', '2019-06-24 15:18:54', '0');
INSERT INTO `sys_menu` VALUES (3700, '注册配置', NULL, '', 3000, 'icon-line', 10, '0', '0', '2018-01-25 11:08:52', '2019-06-24 15:35:10', '1');
INSERT INTO `sys_menu` VALUES (4000, '协同管理', NULL, '/activti', -1, 'icon-kuaisugongzuoliu_o', 3, '0', '0', '2018-09-26 01:38:13', '2018-09-28 08:58:24', '0');
INSERT INTO `sys_menu` VALUES (4100, '模型管理', NULL, '/activiti/index', 4000, 'icon-weibiaoti13', 1, '0', '0', '2018-09-26 01:39:07', '2019-06-24 15:20:00', '0');
@@ -551,9 +547,6 @@ INSERT INTO `sys_role_menu` VALUES (1, 3300);
INSERT INTO `sys_role_menu` VALUES (1, 3400);
INSERT INTO `sys_role_menu` VALUES (1, 3500);
INSERT INTO `sys_role_menu` VALUES (1, 3600);
INSERT INTO `sys_role_menu` VALUES (1, 3601);
INSERT INTO `sys_role_menu` VALUES (1, 3620);
INSERT INTO `sys_role_menu` VALUES (1, 3630);
INSERT INTO `sys_role_menu` VALUES (1, 4000);
INSERT INTO `sys_role_menu` VALUES (1, 4100);
INSERT INTO `sys_role_menu` VALUES (1, 4101);
-39
View File
@@ -7,45 +7,6 @@ USE pigxx_job;
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for job_execution_log
-- ----------------------------
DROP TABLE IF EXISTS `job_execution_log`;
CREATE TABLE `job_execution_log` (
`id` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`job_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`task_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`hostname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`sharding_item` int(11) NOT NULL,
`execution_source` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`failure_cause` varchar(4000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`is_success` int(11) NOT NULL,
`start_time` timestamp NULL DEFAULT NULL,
`complete_time` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='任务日志表';
-- ----------------------------
-- Table structure for job_status_trace_log
-- ----------------------------
DROP TABLE IF EXISTS `job_status_trace_log`;
CREATE TABLE `job_status_trace_log` (
`id` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`job_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`original_task_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`task_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`slave_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`source` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`execution_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`sharding_item` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`state` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`message` varchar(4000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`creation_time` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
KEY `TASK_ID_STATE_INDEX` (`task_id`,`state`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='任务轨迹表';
-- ----------------------------
-- Table structure for qrtz_blob_triggers
-- ----------------------------
+2 -2
View File
@@ -35,10 +35,10 @@ BEGIN;
INSERT INTO `config_info` VALUES (1, 'application-dev.yml', 'DEFAULT_GROUP', 'jasypt:\n encryptor:\n password: pigx\n \nspring:\n redis:\n host: pigx-redis\n servlet:\n multipart:\n max-file-size: 100MB\n max-request-size: 100MB\n cloud:\n sentinel:\n eager: true\n filter:\n url-patterns: /** \n transport:\n dashboard: pigx-sentinel:5020\n \nmanagement:\n endpoints:\n web:\n exposure:\n include: \'*\'\n\nfeign:\n sentinel:\n enabled: true\n okhttp:\n enabled: true\n httpclient:\n enabled: false\n client:\n config:\n default:\n connectTimeout: 10000\n readTimeout: 10000\n compression:\n request:\n enabled: true\n response:\n enabled: true\n\nribbon:\n ReadTimeout: 10000\n ConnectTimeout: 10000\n\n#开启灰度\ngray:\n rule:\n enabled: true\n\nmybatis-plus:\n tenant-enable: ture\n mapper-locations: classpath:/mapper/*Mapper.xml\n global-config:\n banner: false\n db-config:\n id-type: auto\n field-strategy: NOT_EMPTY\n type-handlers-package: com.pig4cloud.pigx.common.data.handler\n\nswagger:\n title: PigX Swagger API\n license: Powered By PigX\n licenseUrl: https://pig4cloud.com/\n terms-of-service-url: https://pig4cloud.com/\n contact:\n email: wangiegie@gmail.com\n url: https://pig4cloud.com/about.html\n authorization:\n name: pigX OAuth\n auth-regex: ^.*$\n authorization-scope-list:\n - scope: server\n description: server all\n token-url-list:\n - http://${GATEWAY-HOST:pigx-gateway}:${GATEWAY-PORT:9999}/auth/oauth/token\n\nsecurity:\n oauth2:\n client:\n ignore-urls:\n - /actuator/**\n - /v2/api-docs\n resource:\n loadBalanced: true\n token-info-uri: http://pigx-auth/oauth/check_token', '954b56ac77f2691529aad5c497591b28', '2019-04-18 02:10:20', '2020-02-24 13:58:21', NULL, '172.17.0.125', '', '', '通用配置文件', 'null', 'null', 'yaml', 'null');
INSERT INTO `config_info` VALUES (2, 'pigx-auth-dev.yml', 'DEFAULT_GROUP', '# 数据源\nspring:\n datasource:\n type: com.alibaba.druid.pool.DruidDataSource\n druid:\n driver-class-name: com.mysql.cj.jdbc.Driver\n username: ${MYSQL-USER:root}\n password: ${MYSQL-PWD:root}\n url: jdbc:mysql://${MYSQL-HOST:pigx-mysql}:${MYSQL-PORT:3306}/${MYSQL-DB:pigxx}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true\n freemarker:\n allow-request-override: false\n allow-session-override: false\n cache: true\n charset: UTF-8\n check-template-location: true\n content-type: text/html\n enabled: true\n expose-request-attributes: false\n expose-session-attributes: false\n expose-spring-macro-helpers: true\n prefer-file-system-access: true\n suffix: .ftl\n template-loader-path: classpath:/templates/', 'a6674e6747c1a0bb6c6d78e13706f8f0', '2019-04-18 02:11:32', '2019-08-27 18:24:04', NULL, '127.0.0.1', '', '', '认证中心配置文件', 'null', 'null', 'yaml', 'null');
INSERT INTO `config_info` VALUES (3, 'pigx-codegen-dev.yml', 'DEFAULT_GROUP', '## spring security 配置\nsecurity:\n oauth2:\n client:\n client-id: ENC(gPFcUOmJm8WqM3k3eSqS0Q==)\n client-secret: ENC(gPFcUOmJm8WqM3k3eSqS0Q==)\n scope: server\n# 数据源\nspring:\n datasource:\n type: com.alibaba.druid.pool.DruidDataSource\n druid:\n driver-class-name: com.mysql.cj.jdbc.Driver\n username: ${MYSQL-USER:root}\n password: ${MYSQL-PWD:root}\n url: jdbc:mysql://${MYSQL-HOST:pigx-mysql}:${MYSQL-PORT:3306}/${MYSQL-DB:pigxx_codegen}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true\n resources:\n static-locations: classpath:/static/,classpath:/views/\n\npigx:\n tenant:\n column: tenant_id\n tables:\n - gen_datasource_conf', 'b7d132a3ecdfac4252c994adbb65b23a', '2019-04-18 02:12:10', '2019-08-27 18:24:18', NULL, '127.0.0.1', '', '', '代码生成', 'null', 'null', 'yaml', 'null');
INSERT INTO `config_info` VALUES (4, 'pigx-daemon-elastic-job-dev.yml', 'DEFAULT_GROUP', '## spring security 配置\nsecurity:\n oauth2:\n client:\n client-id: ENC(tz2NM4GcmnE7sNJTYL8ZSg==)\n client-secret: ENC(tz2NM4GcmnE7sNJTYL8ZSg==)\n scope: server\n## 定时任务\n# 数据源\nspring:\n datasource:\n type: com.alibaba.druid.pool.DruidDataSource\n druid:\n driver-class-name: com.mysql.cj.jdbc.Driver\n username: ${MYSQL-USER:root}\n password: ${MYSQL-PWD:root}\n url: jdbc:mysql://${MYSQL-HOST:pigx-mysql}:${MYSQL-PORT:3306}/${MYSQL-DB:pigxx_job}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true\n elasticjob:\n # 分布式任务协调依赖zookeeper\n zookeeper:\n server-lists: ${ZOOKEEPER-HOST:pigx-zookeeper}:${ZOOKEEPER-PORT:2181}\n namespace: pigx-daemon\n # 普通任务\n simples:\n spring-simple-job:\n job-class: com.pig4cloud.pigx.daemon.elastic.job.PigxSimpleJob\n cron: 0 0 0/1 * * ?\n sharding-total-count: 3\n sharding-item-parameters: 0=service1,1=service2,2=service3\n eventTraceRdbDataSource: \'dataSource\'\n listener:\n listener-class: com.pig4cloud.pigx.daemon.elastic.listener.PigxElasticJobListener\n spring-simple-job2:\n job-class: com.pig4cloud.pigx.daemon.elastic.job.PigxSimpleJob2\n cron: 0 0 0/1 * * ?\n sharding-total-count: 3\n sharding-item-parameters: 0=service1,1=service2,2=service3\n eventTraceRdbDataSource: \'dataSource\'\n listener:\n listener-class: com.pig4cloud.pigx.daemon.elastic.listener.PigxElasticJobListener\n # 简单任务\n dataflows:\n spring-dataflow-job:\n job-class: com.pig4cloud.pigx.daemon.elastic.job.PigxDataflowJob\n cron: 0 0 0/1 * * ?\n sharding-total-count: 3\n sharding-item-parameters: 0=service1,1=service2,2=service3\n streaming-process: true\n eventTraceRdbDataSource: \'dataSource\'\n listener:\n distributed-listener-class: com.pig4cloud.pigx.daemon.elastic.listener.PigxDistributeElasticJobListener\n started-timeout-milliseconds: 5000\n completed-timeout-milliseconds: 10000\n\nxxl:\n job:\n admin:\n addresses: http://${XXL-HOST:pigx-xxl}:${XXL-HOST:9080}/xxl-job-admin\n executor:\n port: 9988\n appName: test-xxl', '9ce58242d57b57f737dcb59a41ee6e55', '2019-04-18 02:12:57', '2019-10-04 11:22:56', NULL, '127.0.0.1', '', '', '定时任务-elastic-job配置', 'null', 'null', 'yaml', 'null');
INSERT INTO `config_info` VALUES (4, 'pigx-daemon-elastic-job-dev.yml', 'DEFAULT_GROUP', '## spring security 配置\nsecurity:\n oauth2:\n client:\n client-id: ENC(tz2NM4GcmnE7sNJTYL8ZSg==)\n client-secret: ENC(tz2NM4GcmnE7sNJTYL8ZSg==)\n scope: server\n## 定时任务\n# 数据源\nspring:\n datasource:\n type: com.alibaba.druid.pool.DruidDataSource\n druid:\n driver-class-name: com.mysql.cj.jdbc.Driver\n username: ${MYSQL-USER:root}\n password: ${MYSQL-PWD:root}\n url: jdbc:mysql://${MYSQL-HOST:pigx-mysql}:${MYSQL-PORT:3306}/${MYSQL-DB:pigxx_job}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true\n\nxxl:\n job:\n admin:\n addresses: http://${XXL-HOST:pigx-xxl}:${XXL-HOST:9080}/xxl-job-admin\n executor:\n port: 9988\n appName: test-xxl', '9ce58242d57b57f737dcb59a41ee6e55', '2019-04-18 02:12:57', '2019-10-04 11:22:56', NULL, '127.0.0.1', '', '', '定时任务-elastic-job配置', 'null', 'null', 'yaml', 'null');
INSERT INTO `config_info` VALUES (5, 'pigx-gateway-dev.yml', 'DEFAULT_GROUP', 'security:\n encode:\n key: \'pigxpigxpigxpigx\'\n\nignore:\n clients:\n - test\n swagger-providers:\n - pigx-auth\n - pigx-tx-manager\n\nribbon:\n rule:\n gray-enabled: true', '24403a5b205b1e9d320078e309584bbc', '2019-04-18 02:13:52', '2019-10-20 17:07:42', NULL, '127.0.0.1', '', '', '网关配置文件', 'null', 'null', 'yaml', 'null');
INSERT INTO `config_info` VALUES (6, 'pigx-monitor-dev.yml', 'DEFAULT_GROUP', 'spring:\n # 安全配置\n security:\n user:\n name: ENC(rZHA4LW5hHmhLAAzJoFNag==) # pigx\n password: ENC(bjeyh+Aeii3kHXkoo00ZUw==) # pigx\n boot:\n admin:\n ui:\n title: \'pigx 服务状态监控\'\n brand: \'pigx 服务状态监控\'\nmanagement:\n endpoints:\n web:\n exposure:\n include: \'*\'\n endpoint:\n health:\n show-details: ALWAYS #显示详细信息', '7925a0c734460526262319b6a189e39d', '2019-04-18 02:14:17', '2019-12-31 19:04:00', NULL, '172.17.0.157', '', '', '监控配置文件', 'null', 'null', 'yaml', 'null');
INSERT INTO `config_info` VALUES (7, 'pigx-upms-biz-dev.yml', 'DEFAULT_GROUP', '## spring security 配置\nsecurity:\n oauth2:\n client:\n client-id: ENC(ltJPpR50wT0oIY9kfOe1Iw==)\n client-secret: ENC(ltJPpR50wT0oIY9kfOe1Iw==)\n scope: server\n ignore-urls:\n - /druid/**\n - /actuator/**\n - /v2/api-docs\n\n# 数据源\nspring:\n datasource:\n type: com.alibaba.druid.pool.DruidDataSource\n druid:\n driver-class-name: com.mysql.cj.jdbc.Driver\n username: ${MYSQL-USER:root}\n password: ${MYSQL-PWD:root}\n url: jdbc:mysql://${MYSQL-HOST:pigx-mysql}:${MYSQL-PORT:3306}/${MYSQL-DB:pigxx}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true\n stat-view-servlet:\n enabled: true\n url-pattern: /druid/*\n #login-username: admin\n #login-password: admin\n filter:\n stat:\n enabled: true\n log-slow-sql: true\n slow-sql-millis: 10000\n merge-sql: false\n wall:\n config:\n multi-statement-allow: true\n\n# 文件系统 (提供测试环境,不要乱传)\nminio:\n url: http://minio.pig4cloud.com\n access-key: lengleng\n secret-key: lengleng\n\n# Logger Config\nlogging:\n level:\n com.pig4cloud.pigx.admin.mapper: debug\n\n# 租户表维护\npigx:\n tenant:\n column: tenant_id\n tables:\n - sys_user\n - sys_role\n - sys_dept\n - sys_log\n - sys_social_details\n - sys_dict\n - sys_dict_item\n - sys_public_param\n - sys_log\n - sys_file', 'fab3a6b4cb292954d9841b22a41e3dab', '2019-04-18 02:32:44', '2019-11-01 12:22:38', NULL, '127.0.0.1', '', '', 'admin 服务配置', 'null', 'null', 'yaml', 'null');
INSERT INTO `config_info` VALUES (7, 'pigx-upms-biz-dev.yml', 'DEFAULT_GROUP', '## spring security 配置\nsecurity:\n oauth2:\n client:\n client-id: ENC(ltJPpR50wT0oIY9kfOe1Iw==)\n client-secret: ENC(ltJPpR50wT0oIY9kfOe1Iw==)\n scope: server\n ignore-urls:\n - /druid/**\n - /actuator/**\n - /v2/api-docs\n\n# 数据源\nspring:\n datasource:\n type: com.alibaba.druid.pool.DruidDataSource\n druid:\n driver-class-name: com.mysql.cj.jdbc.Driver\n username: ${MYSQL-USER:root}\n password: ${MYSQL-PWD:root}\n url: jdbc:mysql://${MYSQL-HOST:pigx-mysql}:${MYSQL-PORT:3306}/${MYSQL-DB:pigxx}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true\n stat-view-servlet:\n enabled: true\n url-pattern: /druid/*\n #login-username: admin\n #login-password: admin\n filter:\n stat:\n enabled: true\n log-slow-sql: true\n slow-sql-millis: 10000\n merge-sql: false\n wall:\n config:\n multi-statement-allow: true\n\n# 文件系统 (提供测试环境,不要乱传)\nminio:\n url: http://minio.pig4cloud.com\n access-key: lengleng\n secret-key: lengleng\n\n# Logger Config\nlogging:\n level:\n com.pig4cloud.pigx.admin.mapper: debug\n\n# 租户表维护\npigx:\n tenant:\n column: tenant_id\n tables:\n - sys_user\n - sys_role\n - sys_menu\n - sys_dept\n - sys_log\n - sys_social_details\n - sys_dict\n - sys_dict_item\n - sys_public_param\n - sys_log\n - sys_file', 'fab3a6b4cb292954d9841b22a41e3dab', '2019-04-18 02:32:44', '2019-11-01 12:22:38', NULL, '127.0.0.1', '', '', 'admin 服务配置', 'null', 'null', 'yaml', 'null');
INSERT INTO `config_info` VALUES (8, 'pigx-tx-manager-dev.yml', 'DEFAULT_GROUP', '# 页面配置\nspring:\n mvc:\n static-path-pattern: /**\n resources:\n static-locations: classpath:/static/\n\n\n# LCN 配置\ntm:\n transaction:\n netty:\n delaytime: 5 # 客户端链接最大通讯时间 (秒)\n hearttime: 15 # 客户端心跳时间 (秒)\n redis:\n savemaxtime: 30 # redis 保存时间 (秒)\n socket:\n port: 9998 # 通讯端口\n maxconnection: 1000 #最大链接数\n compensate:\n auto: false #是否自动补偿\n notifyUrl: http://ip:port/path #补偿结果通知(配消息总线里面)\n tryTime: 30 # z再次重试时间间隔\n maxWaitTime: 5000 # 请求超时的最大时间 (毫秒)', '885f5c125f2df7a08692929ccce154be', '2019-04-18 02:54:03', '2019-04-18 02:54:03', NULL, '127.0.0.1', '', '', '分布式事务协调模块', NULL, NULL, 'yaml', NULL);
INSERT INTO `config_info` VALUES (9, 'pigx-daemon-quartz-dev.yml', 'DEFAULT_GROUP', '## spring security 配置\nsecurity:\n oauth2:\n client:\n client-id: ENC(tz2NM4GcmnE7sNJTYL8ZSg==)\n client-secret: ENC(tz2NM4GcmnE7sNJTYL8ZSg==)\n scope: server\n\n# 数据源\nspring:\n datasource:\n type: com.alibaba.druid.pool.DruidDataSource\n druid:\n driver-class-name: com.mysql.cj.jdbc.Driver\n username: ${MYSQL-USER:root}\n password: ${MYSQL-PWD:root}\n url: jdbc:mysql://${MYSQL-HOST:pigx-mysql}:${MYSQL-PORT:3306}/${MYSQL-DB:pigxx_job}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true\n resources:\n static-locations: classpath:/static/,classpath:/views/\n quartz:\n #相关属性配置\n properties:\n org:\n quartz:\n scheduler:\n instanceName: clusteredScheduler\n instanceId: AUTO\n jobStore:\n class: org.quartz.impl.jdbcjobstore.JobStoreTX\n driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate\n tablePrefix: QRTZ_\n isClustered: true\n clusterCheckinInterval: 10000\n useProperties: false\n threadPool:\n class: org.quartz.simpl.SimpleThreadPool\n threadCount: 50\n threadPriority: 5\n threadsInheritContextClassLoaderOfInitializingThread: true\n #数据库方式\n job-store-type: jdbc\n #初始化表结构\n #jdbc:\n #initialize-schema: never\n\n', '276cf549fb8b084e35dc07d1eb309932', '2019-04-18 03:08:34', '2019-08-27 18:25:41', NULL, '127.0.0.1', '', '', 'quartz 配置文件', 'null', 'null', 'yaml', 'null');
INSERT INTO `config_info` VALUES (10, 'pigx-pay-platform-dev.yml', 'DEFAULT_GROUP', '## spring security 配置\nsecurity:\n oauth2:\n client:\n client-id: ENC(gPFcUOmJm8WqM3k3eSqS0Q==)\n client-secret: ENC(gPFcUOmJm8WqM3k3eSqS0Q==)\n scope: server\n# 数据源\nspring:\n datasource:\n type: com.alibaba.druid.pool.DruidDataSource\n druid:\n driver-class-name: com.mysql.cj.jdbc.Driver\n username: ${MYSQL-USER:root}\n password: ${MYSQL-PWD:root}\n url: jdbc:mysql://${MYSQL-HOST:pigx-mysql}:${MYSQL-PORT:3306}/${MYSQL-DB:pigxx_pay}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true\n\n# 租户表维护\npigx:\n pay:\n test: lengleng\n aliPayConfig:\n expire-time: 30\n return-url: http://pig4cloud.com\n notify-url: https://admin.pig4cloud.com/pay/notify/ali/callbak\n wxPayConfig:\n notify-url: https://admin.pig4cloud.com/pay/notify/wx/callbak\n xsequence: #发号器相关配置\n db:\n retry-times: 3\n table-name: pay_sequence\n tenant:\n column: tenant_id\n tables:\n - pay_channel\n - pay_trade_order\n - pay_goods_order\n - pay_notify_record', 'bf185a74bb9af224bfe7f8f52ae3c9cb', '2019-05-28 11:46:27', '2019-08-27 18:26:01', NULL, '127.0.0.1', '', '', '支付模块配置', 'null', 'null', 'yaml', 'null');
-5
View File
@@ -19,11 +19,6 @@ services:
- ./pigx-mysql:/var/lib/mysql
command: --lower_case_table_names=1
pigx-zookeeper:
container_name: pigx-zookeeper
image: zookeeper:3.4.13
restart: always
pigx-xxl:
container_name: pigx-xxl
image: pig4cloud/xxl-job-admin:2.1.1
-18
View File
@@ -33,24 +33,6 @@
<description>pigx 定时任务</description>
<dependencies>
<!-- import elastic-job lite core -->
<dependency>
<groupId>com.dangdang</groupId>
<artifactId>elastic-job-lite-core</artifactId>
<version>${elastic-job-lite.version}</version>
<exclusions>
<exclusion>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP-java7</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- import other module if need -->
<dependency>
<groupId>com.dangdang</groupId>
<artifactId>elastic-job-lite-spring</artifactId>
<version>${elastic-job-lite.version}</version>
</dependency>
<!--xxl job-->
<dependency>
<groupId>com.xuxueli</groupId>
@@ -1,87 +0,0 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.common.job;
import com.dangdang.ddframe.job.reg.zookeeper.ZookeeperConfiguration;
import com.dangdang.ddframe.job.reg.zookeeper.ZookeeperRegistryCenter;
import com.pig4cloud.pigx.common.job.jobinit.DataflowJobInitialization;
import com.pig4cloud.pigx.common.job.jobinit.ScriptJobInitialization;
import com.pig4cloud.pigx.common.job.jobinit.SimpleJobInitialization;
import com.pig4cloud.pigx.common.job.properties.ElasticJobProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @author lengleng
* @date 2018/7/24
* 任务初配置入口类
*/
@Configuration
@EnableAutoConfiguration
@EnableConfigurationProperties(ElasticJobProperties.class)
public class ElasticJobAutoConfiguration {
/**
* 默认注册中心
*/
public static final String DEFAULT_REGISTRY_CENTER_NAME = "elasticJobRegistryCenter";
@Autowired
private ElasticJobProperties elasticJobProperties;
@Bean(name = DEFAULT_REGISTRY_CENTER_NAME, initMethod = "init")
@ConditionalOnMissingBean
public ZookeeperRegistryCenter elasticJobRegistryCenter() {
ElasticJobProperties.ZkConfiguration regCenterProperties = elasticJobProperties.getZookeeper();
ZookeeperConfiguration zookeeperConfiguration = new ZookeeperConfiguration(regCenterProperties.getServerLists(), regCenterProperties.getNamespace());
zookeeperConfiguration.setBaseSleepTimeMilliseconds(regCenterProperties.getBaseSleepTimeMilliseconds());
zookeeperConfiguration.setConnectionTimeoutMilliseconds(regCenterProperties.getConnectionTimeoutMilliseconds());
zookeeperConfiguration.setMaxSleepTimeMilliseconds(regCenterProperties.getMaxSleepTimeMilliseconds());
zookeeperConfiguration.setSessionTimeoutMilliseconds(regCenterProperties.getSessionTimeoutMilliseconds());
zookeeperConfiguration.setMaxRetries(regCenterProperties.getMaxRetries());
zookeeperConfiguration.setDigest(regCenterProperties.getDigest());
return new ZookeeperRegistryCenter(zookeeperConfiguration);
}
@Bean(initMethod = "init")
@ConditionalOnMissingBean
@ConditionalOnBean(ZookeeperRegistryCenter.class)
public SimpleJobInitialization simpleJobInitialization() {
return new SimpleJobInitialization(elasticJobProperties.getSimples());
}
@Bean(initMethod = "init")
@ConditionalOnMissingBean
@ConditionalOnBean(ZookeeperRegistryCenter.class)
public DataflowJobInitialization dataflowJobInitialization() {
return new DataflowJobInitialization(elasticJobProperties.getDataflows());
}
@Bean(initMethod = "init")
@ConditionalOnMissingBean
@ConditionalOnBean(ZookeeperRegistryCenter.class)
public ScriptJobInitialization scriptJobInitialization() {
return new ScriptJobInitialization(elasticJobProperties.getScripts());
}
}
@@ -1,36 +0,0 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.common.job.annotation;
import com.pig4cloud.pigx.common.job.ElasticJobAutoConfiguration;
import org.springframework.context.annotation.Import;
import java.lang.annotation.*;
/**
* @author lengleng
* @date 2018/7/24
* 开启pigx elastic job
*/
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@Import({ElasticJobAutoConfiguration.class})
public @interface EnablePigxElasticJob {
}
@@ -1,286 +0,0 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.common.job.jobinit;
import com.dangdang.ddframe.job.api.ElasticJob;
import com.dangdang.ddframe.job.api.JobType;
import com.dangdang.ddframe.job.api.dataflow.DataflowJob;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import com.dangdang.ddframe.job.config.JobCoreConfiguration;
import com.dangdang.ddframe.job.config.JobTypeConfiguration;
import com.dangdang.ddframe.job.event.rdb.JobEventRdbConfiguration;
import com.dangdang.ddframe.job.executor.handler.JobProperties.JobPropertiesEnum;
import com.dangdang.ddframe.job.lite.api.listener.AbstractDistributeOnceElasticJobListener;
import com.dangdang.ddframe.job.lite.api.listener.ElasticJobListener;
import com.dangdang.ddframe.job.lite.config.LiteJobConfiguration;
import com.dangdang.ddframe.job.lite.spring.api.SpringJobScheduler;
import com.dangdang.ddframe.job.reg.zookeeper.ZookeeperRegistryCenter;
import com.pig4cloud.pigx.common.job.properties.ElasticJobProperties;
import lombok.SneakyThrows;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.util.CollectionUtils;
import javax.sql.DataSource;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import static com.pig4cloud.pigx.common.job.ElasticJobAutoConfiguration.DEFAULT_REGISTRY_CENTER_NAME;
/**
* @author lengleng
* @date 2018/7/24
* 任务初始化基类
*/
public abstract class AbstractJobInitialization implements ApplicationContextAware {
protected ApplicationContext applicationContext;
@Override
@SneakyThrows
public void setApplicationContext(ApplicationContext applicationContext) {
this.applicationContext = applicationContext;
}
/**
* 初始化任务
*
* @param jobName 任务名称
* @param jobType 任务类型
* @param configuration 配置
*/
protected void initJob(String jobName, JobType jobType, ElasticJobProperties.JobConfiguration configuration) {
//向spring容器中注册作业任务
ElasticJob elasticJob = registerElasticJob(jobName, configuration.getJobClass(), jobType);
//获取注册中心
ZookeeperRegistryCenter regCenter = getZookeeperRegistryCenter(configuration.getRegistryCenterRef());
//构建核心配置
JobCoreConfiguration jobCoreConfiguration = getJobCoreConfiguration(jobName, configuration);
//获取作业类型配置
JobTypeConfiguration jobTypeConfiguration = getJobTypeConfiguration(jobName, jobCoreConfiguration);
//获取Lite作业配置
LiteJobConfiguration liteJobConfiguration = getLiteJobConfiguration(jobTypeConfiguration, configuration);
//获取作业事件追踪的数据源配置
JobEventRdbConfiguration jobEventRdbConfiguration = getJobEventRdbConfiguration(configuration.getEventTraceRdbDataSource());
//获取作业监听器
ElasticJobListener[] elasticJobListeners = creatElasticJobListeners(configuration.getListener());
elasticJobListeners = null == elasticJobListeners ? new ElasticJobListener[0] : elasticJobListeners;
//注册作业
if (null == jobEventRdbConfiguration) {
new SpringJobScheduler(elasticJob, regCenter, liteJobConfiguration, elasticJobListeners).init();
} else {
new SpringJobScheduler(elasticJob, regCenter, liteJobConfiguration, jobEventRdbConfiguration, elasticJobListeners).init();
}
}
/**
* 获取作业类型配置
*
* @param jobName 任务名称
* @param jobCoreConfiguration 任务核心配置
* @return JobTypeConfiguration
*/
public abstract JobTypeConfiguration getJobTypeConfiguration(String jobName, JobCoreConfiguration jobCoreConfiguration);
/**
* 获取作业任务实例
*
* @param jobName 任务名称
* @param jobType 任务类型
* @param strClass 任务类全路径
* @return ElasticJob
*/
private ElasticJob registerElasticJob(String jobName, String strClass, JobType jobType) {
switch (jobType) {
case SIMPLE:
return registerBean(jobName, strClass, SimpleJob.class);
case DATAFLOW:
return registerBean(jobName, strClass, DataflowJob.class);
default:
return null;
}
}
/**
* 获取注册中心
*
* @param registryCenterRef 注册中心引用
* @return ZookeeperRegistryCenter
*/
private ZookeeperRegistryCenter getZookeeperRegistryCenter(String registryCenterRef) {
if (StringUtils.isBlank(registryCenterRef)) {
registryCenterRef = DEFAULT_REGISTRY_CENTER_NAME;
}
if (!applicationContext.containsBean(registryCenterRef)) {
throw new RuntimeException("not exist ZookeeperRegistryCenter [" + registryCenterRef + "] !");
}
return applicationContext.getBean(registryCenterRef, ZookeeperRegistryCenter.class);
}
/**
* 获取作业事件追踪的数据源配置
*
* @param eventTraceRdbDataSource 作业事件追踪的数据源Bean引用
* @return JobEventRdbConfiguration
*/
private JobEventRdbConfiguration getJobEventRdbConfiguration(String eventTraceRdbDataSource) {
if (StringUtils.isBlank(eventTraceRdbDataSource)) {
return null;
}
if (!applicationContext.containsBean(eventTraceRdbDataSource)) {
throw new RuntimeException("not exist datasource [" + eventTraceRdbDataSource + "] !");
}
DataSource dataSource = (DataSource) applicationContext.getBean(eventTraceRdbDataSource);
return new JobEventRdbConfiguration(dataSource);
}
/**
* 构建Lite作业
*
* @param jobTypeConfiguration 任务类型
* @param jobConfiguration 任务配置
* @return LiteJobConfiguration
*/
private LiteJobConfiguration getLiteJobConfiguration(JobTypeConfiguration jobTypeConfiguration, ElasticJobProperties.JobConfiguration jobConfiguration) {
//构建Lite作业
return LiteJobConfiguration.newBuilder(Objects.requireNonNull(jobTypeConfiguration))
.monitorExecution(jobConfiguration.isMonitorExecution())
.monitorPort(jobConfiguration.getMonitorPort())
.maxTimeDiffSeconds(jobConfiguration.getMaxTimeDiffSeconds())
.jobShardingStrategyClass(jobConfiguration.getJobShardingStrategyClass())
.reconcileIntervalMinutes(jobConfiguration.getReconcileIntervalMinutes())
.disabled(jobConfiguration.isDisabled())
.overwrite(jobConfiguration.isOverwrite()).build();
}
/**
* 构建任务核心配置
*
* @param jobName 任务执行名称
* @param jobConfiguration 任务配置
* @return JobCoreConfiguration
*/
protected JobCoreConfiguration getJobCoreConfiguration(String jobName, ElasticJobProperties.JobConfiguration jobConfiguration) {
JobCoreConfiguration.Builder builder = JobCoreConfiguration.newBuilder(jobName, jobConfiguration.getCron(), jobConfiguration.getShardingTotalCount())
.shardingItemParameters(jobConfiguration.getShardingItemParameters())
.jobParameter(jobConfiguration.getJobParameter())
.failover(jobConfiguration.isFailover())
.misfire(jobConfiguration.isMisfire())
.description(jobConfiguration.getDescription());
if (StringUtils.isNotBlank(jobConfiguration.getJobExceptionHandler())) {
builder.jobProperties(JobPropertiesEnum.JOB_EXCEPTION_HANDLER.getKey(), jobConfiguration.getJobExceptionHandler());
}
if (StringUtils.isNotBlank(jobConfiguration.getExecutorServiceHandler())) {
builder.jobProperties(JobPropertiesEnum.EXECUTOR_SERVICE_HANDLER.getKey(), jobConfiguration.getExecutorServiceHandler());
}
return builder.build();
}
/**
* 获取监听器
*
* @param listener 监听器配置
* @return ElasticJobListener[]
*/
private ElasticJobListener[] creatElasticJobListeners(ElasticJobProperties.JobConfiguration.Listener listener) {
if (null == listener) {
return null;
}
List<ElasticJobListener> elasticJobListeners = new ArrayList<>(2);
//注册每台作业节点均执行的监听
ElasticJobListener elasticJobListener = registerBean(listener.getListenerClass(), listener.getListenerClass(), ElasticJobListener.class);
if (null != elasticJobListener) {
elasticJobListeners.add(elasticJobListener);
}
//注册分布式监听者
AbstractDistributeOnceElasticJobListener distributedListener = registerBean(listener.getDistributedListenerClass(), listener.getDistributedListenerClass(),
AbstractDistributeOnceElasticJobListener.class, listener.getStartedTimeoutMilliseconds(), listener.getCompletedTimeoutMilliseconds());
if (null != distributedListener) {
elasticJobListeners.add(distributedListener);
}
if (CollectionUtils.isEmpty(elasticJobListeners)) {
return null;
}
//集合转数组
ElasticJobListener[] elasticJobListenerArray = new ElasticJobListener[elasticJobListeners.size()];
for (int i = 0; i < elasticJobListeners.size(); i++) {
elasticJobListenerArray[i] = elasticJobListeners.get(i);
}
return elasticJobListenerArray;
}
/**
* 向spring容器中注册bean
*
* @param beanName bean名字
* @param strClass 类全路径
* @param tClass 类类型
* @param constructorArgValue 构造函数参数
* @param <T> 泛型
* @return T
*/
protected <T> T registerBean(String beanName, String strClass, Class<T> tClass, Object... constructorArgValue) {
//判断是否配置了监听者
if (StringUtils.isBlank(strClass)) {
return null;
}
if (StringUtils.isBlank(beanName)) {
beanName = strClass;
}
//判断监听者是否已经在spring容器中存在
if (applicationContext.containsBean(beanName)) {
return applicationContext.getBean(beanName, tClass);
}
//不存在则创建并注册到Spring容器中
BeanDefinitionBuilder beanDefinitionBuilder = BeanDefinitionBuilder.rootBeanDefinition(strClass);
beanDefinitionBuilder.setScope(BeanDefinition.SCOPE_PROTOTYPE);
//设置参数
for (Object argValue : constructorArgValue) {
beanDefinitionBuilder.addConstructorArgValue(argValue);
}
getDefaultListableBeanFactory().registerBeanDefinition(beanName, beanDefinitionBuilder.getBeanDefinition());
return applicationContext.getBean(beanName, tClass);
}
/**
* 获取beanFactory
*
* @return DefaultListableBeanFactory
*/
private DefaultListableBeanFactory getDefaultListableBeanFactory() {
return (DefaultListableBeanFactory) ((ConfigurableApplicationContext) applicationContext).getBeanFactory();
}
}
@@ -1,53 +0,0 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.common.job.jobinit;
import com.dangdang.ddframe.job.config.JobCoreConfiguration;
import com.dangdang.ddframe.job.config.JobTypeConfiguration;
import com.dangdang.ddframe.job.config.dataflow.DataflowJobConfiguration;
import com.pig4cloud.pigx.common.job.properties.ElasticJobProperties;
import java.util.Map;
/**
* @author lengleng
* @date 2018/7/24
* 流式任务初始
*/
public class DataflowJobInitialization extends AbstractJobInitialization {
private Map<String, ElasticJobProperties.DataflowConfiguration> dataflowConfigurationMap;
public DataflowJobInitialization(final Map<String, ElasticJobProperties.DataflowConfiguration> dataflowConfigurationMap) {
this.dataflowConfigurationMap = dataflowConfigurationMap;
}
public void init() {
for (String jobName : dataflowConfigurationMap.keySet()) {
ElasticJobProperties.DataflowConfiguration configuration = dataflowConfigurationMap.get(jobName);
initJob(jobName, configuration.getJobType(), configuration);
}
}
@Override
public JobTypeConfiguration getJobTypeConfiguration(String jobName, JobCoreConfiguration jobCoreConfiguration) {
ElasticJobProperties.DataflowConfiguration configuration = dataflowConfigurationMap.get(jobName);
return new DataflowJobConfiguration(jobCoreConfiguration, configuration.getJobClass(), configuration.isStreamingProcess());
}
}
@@ -1,53 +0,0 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.common.job.jobinit;
import com.dangdang.ddframe.job.config.JobCoreConfiguration;
import com.dangdang.ddframe.job.config.JobTypeConfiguration;
import com.dangdang.ddframe.job.config.script.ScriptJobConfiguration;
import com.pig4cloud.pigx.common.job.properties.ElasticJobProperties;
import java.util.Map;
/**
* @author lengleng
* @date 2018/7/24
* 脚本任务初始
*/
public class ScriptJobInitialization extends AbstractJobInitialization {
private Map<String, ElasticJobProperties.ScriptConfiguration> scriptConfigurationMap;
public ScriptJobInitialization(final Map<String, ElasticJobProperties.ScriptConfiguration> scriptConfigurationMap) {
this.scriptConfigurationMap = scriptConfigurationMap;
}
public void init() {
for (String jobName : scriptConfigurationMap.keySet()) {
ElasticJobProperties.ScriptConfiguration configuration = scriptConfigurationMap.get(jobName);
initJob(jobName, configuration.getJobType(), configuration);
}
}
@Override
public JobTypeConfiguration getJobTypeConfiguration(String jobName, JobCoreConfiguration jobCoreConfiguration) {
ElasticJobProperties.ScriptConfiguration configuration = scriptConfigurationMap.get(jobName);
return new ScriptJobConfiguration(jobCoreConfiguration, configuration.getScriptCommandLine());
}
}
@@ -1,53 +0,0 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.common.job.jobinit;
import com.dangdang.ddframe.job.config.JobCoreConfiguration;
import com.dangdang.ddframe.job.config.JobTypeConfiguration;
import com.dangdang.ddframe.job.config.simple.SimpleJobConfiguration;
import com.pig4cloud.pigx.common.job.properties.ElasticJobProperties;
import java.util.Map;
/**
* @author lengleng
* @date 2018/7/24
* 简单任务初始
*/
public class SimpleJobInitialization extends AbstractJobInitialization {
private Map<String, ElasticJobProperties.SimpleConfiguration> simpleConfigurationMap;
public SimpleJobInitialization(final Map<String, ElasticJobProperties.SimpleConfiguration> simpleConfigurationMap) {
this.simpleConfigurationMap = simpleConfigurationMap;
}
public void init() {
for (String jobName : simpleConfigurationMap.keySet()) {
ElasticJobProperties.SimpleConfiguration configuration = simpleConfigurationMap.get(jobName);
initJob(jobName, configuration.getJobType(), configuration);
}
}
@Override
public JobTypeConfiguration getJobTypeConfiguration(String jobName, JobCoreConfiguration jobCoreConfiguration) {
ElasticJobProperties.SimpleConfiguration configuration = simpleConfigurationMap.get(jobName);
return new SimpleJobConfiguration(jobCoreConfiguration, configuration.getJobClass());
}
}
@@ -1,293 +0,0 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.common.job.properties;
import com.dangdang.ddframe.job.api.JobType;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import java.util.LinkedHashMap;
import java.util.Map;
import static com.pig4cloud.pigx.common.job.ElasticJobAutoConfiguration.DEFAULT_REGISTRY_CENTER_NAME;
/**
* @author lengleng
* @date 2018/7/24
* 任务配置类
*/
@Getter
@Setter
@ConfigurationProperties(prefix = "spring.elasticjob")
public class ElasticJobProperties {
/**
* 注册中心
*/
private ZkConfiguration zookeeper;
/**
* 简单作业配置
*/
private Map<String, SimpleConfiguration> simples = new LinkedHashMap<>();
/**
* 流式作业配置
*/
private Map<String, DataflowConfiguration> dataflows = new LinkedHashMap<>();
/**
* 脚本作业配置
*/
private Map<String, ScriptConfiguration> scripts = new LinkedHashMap<>();
@Getter
@Setter
public static class ZkConfiguration {
/**
* 连接Zookeeper服务器的列表
* 包括IP地址和端口号
* 多个地址用逗号分隔
* 如: host1:2181,host2:2181
*/
private String serverLists;
/**
* Zookeeper的命名空间
*/
private String namespace;
/**
* 等待重试的间隔时间的初始值
* 单位:毫秒
*/
private int baseSleepTimeMilliseconds = 1000;
/**
* 等待重试的间隔时间的最大值
* 单位:毫秒
*/
private int maxSleepTimeMilliseconds = 3000;
/**
* 最大重试次数
*/
private int maxRetries = 3;
/**
* 连接超时时间
* 单位:毫秒
*/
private int connectionTimeoutMilliseconds = 15000;
/**
* 会话超时时间
* 单位:毫秒
*/
private int sessionTimeoutMilliseconds = 60000;
/**
* 连接Zookeeper的权限令牌
* 缺省为不需要权限验
*/
private String digest;
}
@Getter
@Setter
public static class SimpleConfiguration extends JobConfiguration {
/**
* 作业类型
*/
private final JobType jobType = JobType.SIMPLE;
}
@Getter
@Setter
public static class DataflowConfiguration extends JobConfiguration {
/**
* 作业类型
*/
private final JobType jobType = JobType.DATAFLOW;
/**
* 是否流式处理数据
* 如果流式处理数据, 则fetchData不返回空结果将持续执行作业
* 如果非流式处理数据, 则处理数据完成后作业结束
*/
private boolean streamingProcess = false;
}
@Getter
@Setter
public static class ScriptConfiguration extends JobConfiguration {
/**
* 作业类型
*/
private final JobType jobType = JobType.SCRIPT;
/**
* 脚本型作业执行命令行
*/
private String scriptCommandLine;
}
@Getter
@Setter
public static class JobConfiguration {
/**
* 作业实现类,需实现ElasticJob接口
*/
private String jobClass;
/**
* 注册中心Bean的引用,需引用reg:zookeeper的声明
*/
private String registryCenterRef = DEFAULT_REGISTRY_CENTER_NAME;
/**
* cron表达式,用于控制作业触发时间
*/
private String cron;
/**
* 作业分片总数
*/
private int shardingTotalCount = 1;
/**
* 分片序列号和参数用等号分隔,多个键值对用逗号分隔
* 分片序列号从0开始,不可大于或等于作业分片总数
* 如:0=a,1=b,2=c
*/
private String shardingItemParameters = "0=A";
/**
* 作业实例主键,同IP可运行实例主键不同, 但名称相同的多个作业实例
*/
private String jobInstanceId;
/**
* 作业自定义参数
* 作业自定义参数,可通过传递该参数为作业调度的业务方法传参,用于实现带参数的作业
* 例:每次获取的数据量、作业实例从数据库读取的主键等
*/
private String jobParameter;
/**
* 监控作业运行时状态
* 每次作业执行时间和间隔时间均非常短的情况,建议不监控作业运行时状态以提升效率。
* 因为是瞬时状态,所以无必要监控。请用户自行增加数据堆积监控。并且不能保证数据重复选取,应在作业中实现幂等性。
* 每次作业执行时间和间隔时间均较长的情况,建议监控作业运行时状态,可保证数据不会重复选取。
*/
private boolean monitorExecution = true;
/**
* 作业监控端口
* 建议配置作业监控端口, 方便开发者dump作业信息。
* 使用方法: echo “dump” | nc 127.0.0.1 9888
*/
private int monitorPort = -1;
/**
* 最大允许的本机与注册中心的时间误差秒数
* 如果时间误差超过配置秒数则作业启动时将抛异常
* 配置为-1表示不校验时间误差
*/
private int maxTimeDiffSeconds = -1;
/**
* 是否开启失效转移
*/
private boolean failover = false;
/**
* 是否开启错过任务重新执行
*/
private boolean misfire = true;
/**
* 作业分片策略实现类全路径
* 默认使用平均分配策略
* 详情参见:作业分片策略http://elasticjob.io/docs/elastic-job-lite/02-guide/job-sharding-strategy
*/
private String jobShardingStrategyClass;
/**
* 作业描述信息
*/
private String description;
/**
* 作业是否禁止启动
* 可用于部署作业时,先禁止启动,部署结束后统一启动
*/
private boolean disabled = false;
/**
* 本地配置是否可覆盖注册中心配置
* 如果可覆盖,每次启动作业都以本地配置为准
*/
private boolean overwrite = true;
/**
* 扩展异常处理类
*/
private String jobExceptionHandler;
/**
* 扩展作业处理线程池类
*/
private String executorServiceHandler;
/**
* 修复作业服务器不一致状态服务调度间隔时间,配置为小于1的任意值表示不执行修复
* 单位:分钟
*/
private int reconcileIntervalMinutes = 10;
/**
* 作业事件追踪的数据源Bean引用
*/
private String eventTraceRdbDataSource;
/**
* 监听器
*/
private Listener listener;
@Getter
@Setter
public static class Listener {
/**
* 每台作业节点均执行的监听
* 若作业处理作业服务器的文件,处理完成后删除文件,可考虑使用每个节点均执行清理任务。
* 此类型任务实现简单,且无需考虑全局分布式任务是否完成,请尽量使用此类型监听器。
*
* <p>注意:类必须继承com.dangdang.ddframe.job.lite.api.listener.ElasticJobListener</p>
*/
String listenerClass;
/**
* 分布式场景中仅单一节点执行的监听
* 若作业处理数据库数据,处理完成后只需一个节点完成数据清理任务即可。
* 此类型任务处理复杂,需同步分布式环境下作业的状态同步,提供了超时设置来避免作业不同步导致的死锁,请谨慎使用。
*
* <p>注意:类必须继承com.dangdang.ddframe.job.lite.api.listener.AbstractDistributeOnceElasticJobListener</p>
*/
String distributedListenerClass;
/**
* 最后一个作业执行前的执行方法的超时时间
* 单位:毫秒
*/
Long startedTimeoutMilliseconds = Long.MAX_VALUE;
/**
* 最后一个作业执行后的执行方法的超时时间
* 单位:毫秒
*/
Long completedTimeoutMilliseconds = Long.MAX_VALUE;
}
}
}
+1 -1
View File
@@ -29,7 +29,7 @@
<artifactId>pigx-daemon-elastic-job</artifactId>
<packaging>jar</packaging>
<description>基于elastic-job后台跑批定时任务模块</description>
<description>基于xxl-job后台跑批定时任务模块</description>
<dependencies>
<!--注册中心客户端-->
@@ -1,98 +0,0 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.daemon.elastic.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pig4cloud.pigx.common.core.util.R;
import com.pig4cloud.pigx.daemon.elastic.entity.ExecutionLog;
import com.pig4cloud.pigx.daemon.elastic.service.ExecutionLogService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
/**
* @author lengleng
* @date 2018-08-03 22:15:56
*/
@RestController
@RequestMapping("/execution-log")
@AllArgsConstructor
public class ExecutionLogController {
private final ExecutionLogService executionLogService;
/**
* 任务日志处理简单分页查询
*
* @param page 分页对象
* @param executionLog 任务日志处理
* @return
*/
@GetMapping("/page")
public R getExecutionLogPage(Page page, ExecutionLog executionLog) {
return R.ok(executionLogService.page(page, Wrappers.query(executionLog)));
}
/**
* 通过id查询一条记录
*
* @param id
* @return R
*/
@GetMapping("/{id}")
public R getById(@PathVariable("id") String id) {
return R.ok(executionLogService.getById(id));
}
/**
* 保存
*
* @param executionLog
* @return R
*/
@PostMapping
public R save(@RequestBody ExecutionLog executionLog) {
return R.ok(executionLogService.save(executionLog));
}
/**
* 修改
*
* @param executionLog
* @return R
*/
@PutMapping
public R update(@RequestBody ExecutionLog executionLog) {
return R.ok(executionLogService.updateById(executionLog));
}
/**
* 删除
*
* @param id
* @return R
*/
@DeleteMapping("/{id}")
public R removeById(@PathVariable String id) {
return R.ok(executionLogService.removeById(id));
}
}
@@ -1,96 +0,0 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.daemon.elastic.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pig4cloud.pigx.common.core.util.R;
import com.pig4cloud.pigx.daemon.elastic.entity.StatusTraceLog;
import com.pig4cloud.pigx.daemon.elastic.service.StatusTraceLogService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
/**
* @author lengleng
* @date 2018-08-03 22:15:45
*/
@RestController
@AllArgsConstructor
@RequestMapping("/status-trace-log")
public class StatusTraceLogController {
private final StatusTraceLogService statusTraceLogService;
/**
* 任务轨迹处理简单分页查询
*
* @param page 分页对象
* @param statusTraceLog 任务轨迹处理
* @return
*/
@GetMapping("/page")
public R getStatusTraceLogPage(Page<StatusTraceLog> page, StatusTraceLog statusTraceLog) {
return R.ok(statusTraceLogService.page(page, Wrappers.query(statusTraceLog)));
}
/**
* 信息
*
* @param id
* @return R
*/
@GetMapping("/{id}")
public R getById(@PathVariable("id") String id) {
return R.ok(statusTraceLogService.getById(id));
}
/**
* 保存
*
* @param statusTraceLog
* @return R
*/
@PostMapping
public R save(@RequestBody StatusTraceLog statusTraceLog) {
return R.ok(statusTraceLogService.save(statusTraceLog));
}
/**
* 修改
*
* @param statusTraceLog
* @return R
*/
@PutMapping
public R update(@RequestBody StatusTraceLog statusTraceLog) {
return R.ok(statusTraceLogService.updateById(statusTraceLog));
}
/**
* 删除
*
* @param id
* @return R
*/
@DeleteMapping("/{id}")
public R removeById(@PathVariable("id") String id) {
return R.ok(statusTraceLogService.removeById(id));
}
}
@@ -1,77 +0,0 @@
package com.pig4cloud.pigx.daemon.elastic.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
*
*
* @author lengleng
* @date 2018-08-03 22:15:56
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("job_execution_log")
public class ExecutionLog extends Model<ExecutionLog> {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId
private String id;
/**
*
*/
private String jobName;
/**
*
*/
private String taskId;
/**
*
*/
private String hostname;
/**
*
*/
private String ip;
/**
*
*/
private Integer shardingItem;
/**
*
*/
private String executionSource;
/**
*
*/
private String failureCause;
/**
*
*/
private Integer isSuccess;
/**
*
*/
private LocalDateTime startTime;
/**
*
*/
private LocalDateTime completeTime;
/**
* 主键值
*/
@Override
protected Serializable pkVal() {
return this.id;
}
}
@@ -1,69 +0,0 @@
package com.pig4cloud.pigx.daemon.elastic.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
/**
*
*
* @author lengleng
* @date 2018-08-03 22:15:45
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("job_status_trace_log")
public class StatusTraceLog extends Model<StatusTraceLog> {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId
private String id;
/**
*
*/
private String jobName;
/**
*
*/
private String originalTaskId;
/**
*
*/
private String taskId;
/**
*
*/
private String slaveId;
/**
*
*/
private String source;
/**
*
*/
private String executionType;
/**
*
*/
private String shardingItem;
/**
*
*/
private String state;
/**
*
*/
private String message;
/**
*
*/
private LocalDateTime creationTime;
}
@@ -1,40 +0,0 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.daemon.elastic.job;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.dataflow.DataflowJob;
import java.util.List;
/**
* @author lengleng
* @date 2018/2/8
*/
public class PigxDataflowJob implements DataflowJob<Integer> {
@Override
public List<Integer> fetchData(ShardingContext shardingContext) {
return null;
}
@Override
public void processData(ShardingContext shardingContext, List<Integer> list) {
}
}
@@ -1,40 +0,0 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.daemon.elastic.job;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import lombok.extern.slf4j.Slf4j;
/**
* @author lengleng
* @date 2018/2/7
* 测试Job
*/
@Slf4j
public class PigxSimpleJob implements SimpleJob {
/**
* 业务执行逻辑
*
* @param shardingContext 分片信息
*/
@Override
public void execute(ShardingContext shardingContext) {
log.info("第一个任务执行啦:{}", shardingContext);
}
}
@@ -1,40 +0,0 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.daemon.elastic.job;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import lombok.extern.slf4j.Slf4j;
/**
* @author lengleng
* @date 2018/2/7
* 测试Job
*/
@Slf4j
public class PigxSimpleJob2 implements SimpleJob {
/**
* 业务执行逻辑
*
* @param shardingContext 分片信息
*/
@Override
public void execute(ShardingContext shardingContext) {
log.info("第二个执行了:{}", shardingContext);
}
}
@@ -1,42 +0,0 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.daemon.elastic.listener;
import com.dangdang.ddframe.job.executor.ShardingContexts;
import com.dangdang.ddframe.job.lite.api.listener.AbstractDistributeOnceElasticJobListener;
/**
* @author lengleng
* @date 2018/7/24
*/
public class PigxDistributeElasticJobListener extends AbstractDistributeOnceElasticJobListener {
public PigxDistributeElasticJobListener(long startedTimeoutMilliseconds, long completedTimeoutMilliseconds) {
super(startedTimeoutMilliseconds, completedTimeoutMilliseconds);
}
@Override
public void doBeforeJobExecutedAtLastStarted(ShardingContexts shardingContexts) {
System.out.println(shardingContexts.getJobName() + " | MyDistributeElasticJobListener doBeforeJobExecutedAtLastStarted...");
}
@Override
public void doAfterJobExecutedAtLastCompleted(ShardingContexts shardingContexts) {
System.out.println(shardingContexts.getJobName() + " | MyDistributeElasticJobListener doAfterJobExecutedAtLastCompleted...");
}
}
@@ -1,39 +0,0 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.pig4cloud.pigx.daemon.elastic.listener;
import com.dangdang.ddframe.job.executor.ShardingContexts;
import com.dangdang.ddframe.job.lite.api.listener.ElasticJobListener;
/**
* @author lengleng
* @date 2018/7/24
* 任务监听器
*/
public class PigxElasticJobListener implements ElasticJobListener {
@Override
public void beforeJobExecuted(ShardingContexts shardingContexts) {
System.out.println(shardingContexts.getJobName() + " | MyElasticJobListener beforeJobExecuted");
}
@Override
public void afterJobExecuted(ShardingContexts shardingContexts) {
System.out.println(shardingContexts.getJobName() + " | MyElasticJobListener afterJobExecuted");
}
}
@@ -1,16 +0,0 @@
package com.pig4cloud.pigx.daemon.elastic.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pig4cloud.pigx.daemon.elastic.entity.ExecutionLog;
import org.apache.ibatis.annotations.Mapper;
/**
* 任务日志处理
*
* @author lishangbu
* @date 2018/11/22
*/
@Mapper
public interface ExecutionLogMapper extends BaseMapper<ExecutionLog> {
}
@@ -1,16 +0,0 @@
package com.pig4cloud.pigx.daemon.elastic.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pig4cloud.pigx.daemon.elastic.entity.StatusTraceLog;
import org.apache.ibatis.annotations.Mapper;
/**
* 任务轨迹处理
*
* @author lishangbu
* @date 2018/11/22
*/
@Mapper
public interface StatusTraceLogMapper extends BaseMapper<StatusTraceLog> {
}
@@ -1,14 +0,0 @@
package com.pig4cloud.pigx.daemon.elastic.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.pig4cloud.pigx.daemon.elastic.entity.ExecutionLog;
/**
* 任务日志处理
*
* @author lishangbu
* @date 2018-10-27 10:55:42
*/
public interface ExecutionLogService extends IService<ExecutionLog> {
}
@@ -1,14 +0,0 @@
package com.pig4cloud.pigx.daemon.elastic.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.pig4cloud.pigx.daemon.elastic.entity.StatusTraceLog;
/**
* 任务轨迹处理
*
* @author lishangbu
* @date 2018-10-28 07:18:05
*/
public interface StatusTraceLogService extends IService<StatusTraceLog> {
}
@@ -1,18 +0,0 @@
package com.pig4cloud.pigx.daemon.elastic.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pig4cloud.pigx.daemon.elastic.entity.ExecutionLog;
import com.pig4cloud.pigx.daemon.elastic.mapper.ExecutionLogMapper;
import com.pig4cloud.pigx.daemon.elastic.service.ExecutionLogService;
import org.springframework.stereotype.Service;
/**
* 任务日志处理
*
* @author lishangbu
* @date 2018/11/22
*/
@Service("executionLogService")
public class ExecutionLogServiceImpl extends ServiceImpl<ExecutionLogMapper, ExecutionLog> implements ExecutionLogService {
}
@@ -1,20 +0,0 @@
package com.pig4cloud.pigx.daemon.elastic.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pig4cloud.pigx.daemon.elastic.entity.StatusTraceLog;
import com.pig4cloud.pigx.daemon.elastic.mapper.StatusTraceLogMapper;
import com.pig4cloud.pigx.daemon.elastic.service.StatusTraceLogService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
/**
* 任务轨迹处理
*
* @author lishangbu
* @date 2018/11/22
*/
@Service("statusTraceLogService")
@AllArgsConstructor
public class StatusTraceLogServiceImpl extends ServiceImpl<StatusTraceLogMapper, StatusTraceLog> implements StatusTraceLogService {
}
+1 -2
View File
@@ -50,12 +50,11 @@
<jasypt.version>2.1.1</jasypt.version>
<ttl.version>2.11.2</ttl.version>
<minio.version>6.0.11</minio.version>
<elastic-job-lite.version>2.1.5</elastic-job-lite.version>
<xxl.job.version>2.1.1</xxl.job.version>
<security.oauth.version>2.3.6.RELEASE</security.oauth.version>
<activiti.version>5.22.0</activiti.version>
<docker.registry>172.17.0.111</docker.registry>
<docker.host>http://172.17.0.111:2375</docker.host>
<docker.host>http://172.17.0.140:2375</docker.host>
<docker.namespace>library</docker.namespace>
<docker.username>admin</docker.username>
<docker.password>Harbor12345</docker.password>