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 {
+ /**
+ * 每台作业节点均执行的监听
+ * 若作业处理作业服务器的文件,处理完成后删除文件,可考虑使用每个节点均执行清理任务。
+ * 此类型任务实现简单,且无需考虑全局分布式任务是否完成,请尽量使用此类型监听器。
+ *
+ * 注意:类必须继承com.dangdang.ddframe.job.lite.api.listener.ElasticJobListener
+ */
+ String listenerClass;
+
+ /**
+ * 分布式场景中仅单一节点执行的监听
+ * 若作业处理数据库数据,处理完成后只需一个节点完成数据清理任务即可。
+ * 此类型任务处理复杂,需同步分布式环境下作业的状态同步,提供了超时设置来避免作业不同步导致的死锁,请谨慎使用。
+ *
+ * 注意:类必须继承com.dangdang.ddframe.job.lite.api.listener.AbstractDistributeOnceElasticJobListener
+ */
+ String distributedListenerClass;
+
+ /**
+ * 最后一个作业执行前的执行方法的超时时间
+ * 单位:毫秒
+ */
+ Long startedTimeoutMilliseconds = Long.MAX_VALUE;
+
+ /**
+ * 最后一个作业执行后的执行方法的超时时间
+ * 单位:毫秒
+ */
+ Long completedTimeoutMilliseconds = Long.MAX_VALUE;
+ }
+ }
+
+}
diff --git a/pigx-common/pigx-common-swagger/pom.xml b/pigx-common/pigx-common-swagger/pom.xml
index 898226da2..1b7e63a15 100644
--- a/pigx-common/pigx-common-swagger/pom.xml
+++ b/pigx-common/pigx-common-swagger/pom.xml
@@ -30,7 +30,7 @@
pigx-common-swagger
${pigx.version}
jar
- pigx-common-log
+ pigx-common-swagger
pigx 接口文档
diff --git a/pigx-common/pom.xml b/pigx-common/pom.xml
index 441f743c3..5b70d52ef 100644
--- a/pigx-common/pom.xml
+++ b/pigx-common/pom.xml
@@ -35,6 +35,7 @@
pigx-common-core
+ pigx-common-job
pigx-common-log
pigx-common-security
pigx-common-swagger
diff --git a/pigx-config/Dockerfile b/pigx-config/Dockerfile
index fa772aea8..fead92d09 100644
--- a/pigx-config/Dockerfile
+++ b/pigx-config/Dockerfile
@@ -6,7 +6,7 @@ RUN mkdir -p /pigx/bin/com.pig4cloud/pigx-config
WORKDIR /pigx/bin/com.pig4cloud/pigx-config
-EXPOSE 1025
+EXPOSE 4001
ADD ./pigx-config/target/pigx-config.jar ./
diff --git a/pigx-config/src/main/resources/config/pigx-daemon-dev.yml b/pigx-config/src/main/resources/config/pigx-daemon-dev.yml
new file mode 100644
index 000000000..35d1d78dd
--- /dev/null
+++ b/pigx-config/src/main/resources/config/pigx-daemon-dev.yml
@@ -0,0 +1,36 @@
+spring:
+ # 保存定时任务的数据源
+ datasource:
+ type: com.zaxxer.hikari.HikariDataSource
+ driver-class-name: com.mysql.jdbc.Driver
+ username: root
+ password: root
+ url: jdbc:mysql://127.0.0.1:3306/pigx?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false
+ elasticjob:
+ # 分布式任务协调依赖zookeeper
+ zookeeper:
+ server-lists: 127.0.0.1:2181
+ namespace: pigx-daemon
+ # 普通任务
+ simples:
+ spring-simple-job:
+ job-class: com.pig4cloud.pigx.daemon.job.PigxSimpleJob
+ cron: 0/2 * * * * ?
+ sharding-total-count: 3
+ sharding-item-parameters: 0=service1,1=service2,2=service3
+ eventTraceRdbDataSource: 'dataSource'
+ listener:
+ listener-class: com.pig4cloud.pigx.daemon.listener.PigxElasticJobListener
+ # 简单任务
+ dataflows:
+ spring-dataflow-job:
+ job-class: com.pig4cloud.pigx.daemon.job.PigxDataflowJob
+ cron: 0/2 * * * * ?
+ sharding-total-count: 3
+ sharding-item-parameters: 0=service1,1=service2,2=service3
+ streaming-process: true
+ eventTraceRdbDataSource: 'dataSource'
+ listener:
+ distributed-listener-class: com.pig4cloud.pigx.daemon.listener.PigxDistributeElasticJobListener
+ started-timeout-milliseconds: 5000
+ completed-timeout-milliseconds: 10000
diff --git a/pigx-eureka/pom.xml b/pigx-eureka/pom.xml
index 963a5f786..aa03ba98c 100644
--- a/pigx-eureka/pom.xml
+++ b/pigx-eureka/pom.xml
@@ -46,6 +46,11 @@
org.springframework.cloud
spring-cloud-starter-security
+
+
+ org.springframework.cloud
+ spring-cloud-starter-config
+
org.springframework.boot
diff --git a/pigx-eureka/src/main/java/com/pig4cloud/pigx/eureka/security/WebSecurityConfig.java b/pigx-eureka/src/main/java/com/pig4cloud/pigx/eureka/security/WebSecurityConfig.java
index 3faacc7d4..040f89287 100644
--- a/pigx-eureka/src/main/java/com/pig4cloud/pigx/eureka/security/WebSecurityConfig.java
+++ b/pigx-eureka/src/main/java/com/pig4cloud/pigx/eureka/security/WebSecurityConfig.java
@@ -32,7 +32,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable()
.authorizeRequests()
- .antMatchers("actuator/**").permitAll()
+ .antMatchers("/actuator/**").permitAll()
.anyRequest()
.authenticated().and().httpBasic();
}
diff --git a/pigx-eureka/src/main/resources/bootstrap.yml b/pigx-eureka/src/main/resources/bootstrap.yml
index 2c36ec856..4c30a62af 100644
--- a/pigx-eureka/src/main/resources/bootstrap.yml
+++ b/pigx-eureka/src/main/resources/bootstrap.yml
@@ -8,6 +8,12 @@ spring:
password: pig
application:
name: pigx-eureka
+ boot:
+ admin:
+ client:
+ url: http://localhost:5001
+ instance:
+ name: PIGX-EUREKA
# docker-compose部署时候 hostname 换成pigx-eureka
# 类似的 redis 使用pigx-redis ,gateway 换成 pigx-gateway
diff --git a/pigx-gateway/Dockerfile b/pigx-gateway/Dockerfile
index 40afbbe0a..3d765f3ac 100644
--- a/pigx-gateway/Dockerfile
+++ b/pigx-gateway/Dockerfile
@@ -6,7 +6,7 @@ RUN mkdir -p /pigx/bin/com.pig4cloud/pigx-gateway
WORKDIR /pigx/bin/com.pig4cloud/pigx-gateway
-EXPOSE 1025
+EXPOSE 9999
ADD ./pigx-gateway/target/pigx-gateway.jar ./
diff --git a/pigx-visual/pigx-daemon/Dockerfile b/pigx-visual/pigx-daemon/Dockerfile
new file mode 100644
index 000000000..a442fde69
--- /dev/null
+++ b/pigx-visual/pigx-daemon/Dockerfile
@@ -0,0 +1,13 @@
+FROM anapsix/alpine-java:8_server-jre_unlimited
+
+MAINTAINER wangiegie@gmail.com
+
+RUN mkdir -p /pigx/bin/com.pig4cloud/pigx-daemon
+
+WORKDIR /pigx/bin/com.pig4cloud/pigx-daemon
+
+EXPOSE 5002
+
+ADD ./pigx-visual/pigx-daemon/target/pigx-daemon.jar ./
+
+CMD java -Djava.security.egd=file:/dev/./urandom -jar pigx-daemon.jar
diff --git a/pigx-visual/pigx-daemon/pom.xml b/pigx-visual/pigx-daemon/pom.xml
new file mode 100644
index 000000000..7762c78b9
--- /dev/null
+++ b/pigx-visual/pigx-daemon/pom.xml
@@ -0,0 +1,98 @@
+
+
+
+
+ 4.0.0
+
+
+ com.pig4cloud
+ pigx-visual
+ ${pigx.version}
+
+
+ pigx-daemon
+ ${pigx.version}
+ jar
+ pigx-daemon
+ 后台跑批定时任务模块
+
+
+
+
+ org.springframework.cloud
+ spring-cloud-starter-config
+
+
+
+ com.pig4cloud
+ pigx-common-job
+ ${pigx.version}
+
+
+
+ mysql
+ mysql-connector-java
+
+
+ org.springframework.boot
+ spring-boot-starter-jdbc
+
+
+
+ org.apache.curator
+ curator-framework
+ ${curator.version}
+
+
+ org.apache.curator
+ curator-recipes
+ ${curator.version}
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+
+ spring-boot-starter-tomcat
+ org.springframework.boot
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-undertow
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+ ${project.name}
+
+
+
+
+
+
diff --git a/pigx-visual/pigx-daemon/src/main/java/com/pig4cloud/pigx/daemon/PigxDaemonApplication.java b/pigx-visual/pigx-daemon/src/main/java/com/pig4cloud/pigx/daemon/PigxDaemonApplication.java
new file mode 100644
index 000000000..8ad39c45d
--- /dev/null
+++ b/pigx-visual/pigx-daemon/src/main/java/com/pig4cloud/pigx/daemon/PigxDaemonApplication.java
@@ -0,0 +1,37 @@
+/*
+ * 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;
+
+import com.pig4cloud.pigx.common.job.annotation.EnablePigxJob;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+/**
+ * @author lengleng
+ * @date 2018/7/24
+ * 分布式任务调度模块
+ */
+@EnablePigxJob
+@SpringBootApplication
+public class PigxDaemonApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(PigxDaemonApplication.class, args);
+ }
+
+}
diff --git a/pigx-visual/pigx-daemon/src/main/java/com/pig4cloud/pigx/daemon/job/PigxDataflowJob.java b/pigx-visual/pigx-daemon/src/main/java/com/pig4cloud/pigx/daemon/job/PigxDataflowJob.java
new file mode 100644
index 000000000..ccc7523d4
--- /dev/null
+++ b/pigx-visual/pigx-daemon/src/main/java/com/pig4cloud/pigx/daemon/job/PigxDataflowJob.java
@@ -0,0 +1,40 @@
+/*
+ * 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.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 {
+
+ @Override
+ public List fetchData(ShardingContext shardingContext) {
+ return null;
+ }
+
+ @Override
+ public void processData(ShardingContext shardingContext, List list) {
+
+ }
+}
diff --git a/pigx-visual/pigx-daemon/src/main/java/com/pig4cloud/pigx/daemon/job/PigxSimpleJob.java b/pigx-visual/pigx-daemon/src/main/java/com/pig4cloud/pigx/daemon/job/PigxSimpleJob.java
new file mode 100644
index 000000000..5310ba65b
--- /dev/null
+++ b/pigx-visual/pigx-daemon/src/main/java/com/pig4cloud/pigx/daemon/job/PigxSimpleJob.java
@@ -0,0 +1,40 @@
+/*
+ * 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.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:{}", shardingContext);
+ }
+}
diff --git a/pigx-visual/pigx-daemon/src/main/java/com/pig4cloud/pigx/daemon/listener/PigxDistributeElasticJobListener.java b/pigx-visual/pigx-daemon/src/main/java/com/pig4cloud/pigx/daemon/listener/PigxDistributeElasticJobListener.java
new file mode 100644
index 000000000..03934d5fe
--- /dev/null
+++ b/pigx-visual/pigx-daemon/src/main/java/com/pig4cloud/pigx/daemon/listener/PigxDistributeElasticJobListener.java
@@ -0,0 +1,42 @@
+/*
+ * 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.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...");
+ }
+}
diff --git a/pigx-visual/pigx-daemon/src/main/java/com/pig4cloud/pigx/daemon/listener/PigxElasticJobListener.java b/pigx-visual/pigx-daemon/src/main/java/com/pig4cloud/pigx/daemon/listener/PigxElasticJobListener.java
new file mode 100644
index 000000000..cafa8c3c7
--- /dev/null
+++ b/pigx-visual/pigx-daemon/src/main/java/com/pig4cloud/pigx/daemon/listener/PigxElasticJobListener.java
@@ -0,0 +1,39 @@
+/*
+ * 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.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");
+ }
+}
diff --git a/pigx-visual/pigx-daemon/src/main/resources/bootstrap.yml b/pigx-visual/pigx-daemon/src/main/resources/bootstrap.yml
new file mode 100644
index 000000000..da9accb63
--- /dev/null
+++ b/pigx-visual/pigx-daemon/src/main/resources/bootstrap.yml
@@ -0,0 +1,23 @@
+server:
+ port: 5002
+
+spring:
+ application:
+ name: pigx-daemon
+ #配置中心
+ cloud:
+ config:
+ fail-fast: true
+ name: ${spring.application.name}
+ profile: dev
+ discovery:
+ enabled: true
+ service-id: pigx-config
+
+# 注册中心配置
+eureka:
+ instance:
+ prefer-ip-address: true
+ client:
+ service-url:
+ defaultZone: http://pig:pig@localhost:1025/eureka/
diff --git a/pigx-monitor/Dockerfile b/pigx-visual/pigx-monitor/Dockerfile
similarity index 78%
rename from pigx-monitor/Dockerfile
rename to pigx-visual/pigx-monitor/Dockerfile
index b48ea7e08..09feb12a2 100644
--- a/pigx-monitor/Dockerfile
+++ b/pigx-visual/pigx-monitor/Dockerfile
@@ -6,8 +6,8 @@ RUN mkdir -p /pigx/bin/com.pig4cloud/pigx-monitor
WORKDIR /pigx/bin/com.pig4cloud/pigx-monitor
-EXPOSE 1025
+EXPOSE 5001
-ADD ./pigx-monitor/target/pigx-monitor.jar ./
+ADD ./pigx-visual/pigx-monitor/target/pigx-monitor.jar ./
CMD java -Djava.security.egd=file:/dev/./urandom -jar pigx-monitor.jar
diff --git a/pigx-monitor/pom.xml b/pigx-visual/pigx-monitor/pom.xml
similarity index 92%
rename from pigx-monitor/pom.xml
rename to pigx-visual/pigx-monitor/pom.xml
index 467dbcc54..cb69eb933 100644
--- a/pigx-monitor/pom.xml
+++ b/pigx-visual/pigx-monitor/pom.xml
@@ -23,7 +23,7 @@
4.0.0
com.pig4cloud
- pigx
+ pigx-visual
${pigx.version}
@@ -46,6 +46,11 @@
org.springframework.cloud
spring-cloud-starter-config
+
+
+ org.springframework.cloud
+ spring-cloud-starter-config
+
org.springframework.boot
diff --git a/pigx-monitor/src/main/java/com/pig4cloud/pigx/monitor/PigxMonitorApplication.java b/pigx-visual/pigx-monitor/src/main/java/com/pig4cloud/pigx/monitor/PigxMonitorApplication.java
similarity index 100%
rename from pigx-monitor/src/main/java/com/pig4cloud/pigx/monitor/PigxMonitorApplication.java
rename to pigx-visual/pigx-monitor/src/main/java/com/pig4cloud/pigx/monitor/PigxMonitorApplication.java
diff --git a/pigx-monitor/src/main/resources/bootstrap.yml b/pigx-visual/pigx-monitor/src/main/resources/bootstrap.yml
similarity index 100%
rename from pigx-monitor/src/main/resources/bootstrap.yml
rename to pigx-visual/pigx-monitor/src/main/resources/bootstrap.yml
diff --git a/pigx-visual/pom.xml b/pigx-visual/pom.xml
new file mode 100644
index 000000000..247f92c7e
--- /dev/null
+++ b/pigx-visual/pom.xml
@@ -0,0 +1,40 @@
+
+
+
+
+ 4.0.0
+
+ com.pig4cloud
+ pigx
+ ${pigx.version}
+
+
+ pigx-visual
+ ${pigx.version}
+ pigx-visual
+ pigx 图形化功能模块
+ pom
+
+
+ pigx-daemon
+ pigx-monitor
+
+
diff --git a/pom.xml b/pom.xml
index 8d74b2802..c3e96df42 100644
--- a/pom.xml
+++ b/pom.xml
@@ -37,7 +37,7 @@
- 1.2.4
+ 1.3.0
2.0.3.RELEASE
Finchley.RELEASE
UTF-8
@@ -50,6 +50,9 @@
1.2.47
0.0.9
2.9.2
+ 2.0.0
+ 2.10.0
+ 2.1.5
2.3.3.RELEASE
@@ -103,7 +106,7 @@
pigx-auth
pigx-upms
pigx-common
- pigx-monitor
+ pigx-visual