引入另一个任务调度框架:EasyRetry
This commit is contained in:
parent
2219f02a17
commit
ee3272918b
18
pom.xml
18
pom.xml
@ -47,6 +47,7 @@
|
||||
<alibaba-ttl.version>2.14.4</alibaba-ttl.version>
|
||||
<spring-boot-admin.version>3.2.3</spring-boot-admin.version>
|
||||
<powerjob.version>4.3.6</powerjob.version>
|
||||
<easyretry.version>3.2.0</easyretry.version>
|
||||
<!-- 离线IP地址定位库 -->
|
||||
<ip2region.version>2.7.0</ip2region.version>
|
||||
<!-- OSS 配置 -->
|
||||
@ -432,6 +433,23 @@
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- EasyRetry Client -->
|
||||
<dependency>
|
||||
<groupId>com.aizuda</groupId>
|
||||
<artifactId>easy-retry-client-starter</artifactId>
|
||||
<version>${easyretry.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aizuda</groupId>
|
||||
<artifactId>easy-retry-client-core</artifactId>
|
||||
<version>${easyretry.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aizuda</groupId>
|
||||
<artifactId>easy-retry-client-job-core</artifactId>
|
||||
<version>${easyretry.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 代码生成-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
|
@ -78,11 +78,18 @@
|
||||
<artifactId>spring-boot-admin-starter-client</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- powerjob 客户端 -->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>tech.powerjob</groupId>-->
|
||||
<!-- <artifactId>powerjob-worker-spring-boot-starter</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>com.aizuda</groupId>
|
||||
<artifactId>easy-retry-client-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aizuda</groupId>
|
||||
<artifactId>easy-retry-client-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aizuda</groupId>
|
||||
<artifactId>easy-retry-client-job-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
@ -29,15 +29,15 @@ mybatis-flex:
|
||||
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
|
||||
type: ${spring.datasource.type}
|
||||
# mysql数据库
|
||||
# driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# url: jdbc:mysql://localhost:3306/ruoyi-flex?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true
|
||||
# username: root
|
||||
# password: Root@369
|
||||
#postgresql数据库
|
||||
driver-class-name: org.postgresql.Driver
|
||||
url: jdbc:postgresql://localhost:5432/ruoyi-flex?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://localhost:3306/ruoyi-flex?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: root
|
||||
password: Root@369
|
||||
#postgresql数据库
|
||||
# driver-class-name: org.postgresql.Driver
|
||||
# url: jdbc:postgresql://localhost:5432/ruoyi-flex?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
|
||||
# username: postgres
|
||||
# password: postgres@369
|
||||
|
||||
# redis 单机配置(单机与集群只能开启一个另一个需要注释掉)
|
||||
spring.data:
|
||||
@ -49,7 +49,7 @@ spring.data:
|
||||
# 数据库索引
|
||||
database: 0
|
||||
# 密码(如没有密码请注释掉)
|
||||
password: root
|
||||
# password:
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
# 是否开启ssl
|
||||
@ -97,12 +97,23 @@ powerjob:
|
||||
# 28080 端口 随着主应用端口飘逸 避免集群冲突
|
||||
port: 2${server.port}
|
||||
protocol: http
|
||||
server-address: 127.0.0.1:7070
|
||||
server-address: 127.0.0.1:7700
|
||||
store-strategy: disk
|
||||
allow-lazy-connect-server: false
|
||||
max-appended-wf-context-length: 4096
|
||||
max-result-length: 4096
|
||||
|
||||
--- # easy-retry 配置
|
||||
easy-retry:
|
||||
enabled: false
|
||||
# 需要在EasyRetry后台组管理创建对应名称的组,然后创建任务的时候选择对应的组,才能正确分派任务
|
||||
group-name: "ruoyi_group"
|
||||
token: "ER_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT"
|
||||
server:
|
||||
host: 127.0.0.1
|
||||
port: 1788
|
||||
# 详见 script/sql/easy_retry.sql `er_namespace` 表
|
||||
namespace: ${spring.profiles.active}
|
||||
|
||||
--- # mail 邮件发送
|
||||
mail:
|
||||
|
@ -29,27 +29,27 @@ mybatis-flex:
|
||||
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
|
||||
type: ${spring.datasource.type}
|
||||
# mysql数据库
|
||||
# driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# url: jdbc:mysql://localhost:3306/ruoyi-flex?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true
|
||||
# username: root
|
||||
# password: Root@369
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://localhost:3306/ruoyi-flex?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: Root@369
|
||||
#postgresql数据库
|
||||
driver-class-name: org.postgresql.Driver
|
||||
url: jdbc:postgresql://rm-cn-em93orkmv001b83o.rwlb.rds.aliyuncs.com:5432/ruoyi-flex?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
|
||||
username: root_pg
|
||||
password: Yzl@1998
|
||||
# driver-class-name: org.postgresql.Driver
|
||||
# url: jdbc:postgresql://localhost:5432/ruoyi-flex?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
|
||||
# username: postgres
|
||||
# password: postgres@369
|
||||
|
||||
# redis 单机配置(单机与集群只能开启一个另一个需要注释掉)
|
||||
spring.data:
|
||||
redis:
|
||||
# 地址
|
||||
host: 172.16.0.151
|
||||
host: localhost
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
# 数据库索引
|
||||
database: 0
|
||||
# 密码(如没有密码请注释掉)
|
||||
password: root
|
||||
# password:
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
# 是否开启ssl
|
||||
@ -81,7 +81,7 @@ redisson:
|
||||
spring.boot.admin.client:
|
||||
# 增加客户端开关
|
||||
enabled: true
|
||||
url: http://172.16.0.151:9090/admin
|
||||
url: http://localhost:9090/admin
|
||||
instance:
|
||||
service-host-type: IP
|
||||
username: ruoyi
|
||||
@ -97,12 +97,24 @@ powerjob:
|
||||
# 28080 端口 随着主应用端口飘逸 避免集群冲突
|
||||
port: 2${server.port}
|
||||
protocol: http
|
||||
server-address: 172.16.0.151:7070
|
||||
server-address: 127.0.0.1:7700
|
||||
store-strategy: disk
|
||||
allow-lazy-connect-server: false
|
||||
max-appended-wf-context-length: 4096
|
||||
max-result-length: 4096
|
||||
|
||||
--- # easy-retry 配置
|
||||
easy-retry:
|
||||
enabled: false
|
||||
# 需要在EasyRetry后台组管理创建对应名称的组,然后创建任务的时候选择对应的组,才能正确分派任务
|
||||
group-name: "ruoyi_group"
|
||||
token: "ER_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT"
|
||||
server:
|
||||
host: 127.0.0.1
|
||||
port: 1788
|
||||
# 详见 script/sql/easy_retry.sql `er_namespace` 表
|
||||
namespace: ${spring.profiles.active}
|
||||
|
||||
--- # mail 邮件发送
|
||||
mail:
|
||||
enabled: false
|
||||
|
@ -38,6 +38,20 @@
|
||||
<artifactId>powerjob-official-processors</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- EasyRetry client -->
|
||||
<dependency>
|
||||
<groupId>com.aizuda</groupId>
|
||||
<artifactId>easy-retry-client-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aizuda</groupId>
|
||||
<artifactId>easy-retry-client-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aizuda</groupId>
|
||||
<artifactId>easy-retry-client-job-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
|
@ -0,0 +1,37 @@
|
||||
package com.ruoyi.common.job.config;
|
||||
|
||||
import ch.qos.logback.classic.Logger;
|
||||
import ch.qos.logback.classic.LoggerContext;
|
||||
import ch.qos.logback.classic.spi.ILoggingEvent;
|
||||
import com.aizuda.easy.retry.client.common.appender.EasyRetryLogbackAppender;
|
||||
import com.aizuda.easy.retry.client.common.event.EasyRetryStartingEvent;
|
||||
import com.aizuda.easy.retry.client.starter.EnableEasyRetry;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
/**
|
||||
* 启动定时任务
|
||||
*
|
||||
* @author dhb52
|
||||
* @since 2024/3/12
|
||||
*/
|
||||
@AutoConfiguration
|
||||
@ConditionalOnProperty(prefix = "easy-retry", name = "enabled", havingValue = "true")
|
||||
@EnableScheduling
|
||||
@EnableEasyRetry(group = "${easy-retry.group-name}")
|
||||
public class EasyRetryConfig {
|
||||
|
||||
@EventListener(EasyRetryStartingEvent.class)
|
||||
public void onStarting(EasyRetryStartingEvent event) {
|
||||
LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
|
||||
EasyRetryLogbackAppender<ILoggingEvent> ca = new EasyRetryLogbackAppender<>();
|
||||
ca.setName("easy_log_appender");
|
||||
ca.start();
|
||||
Logger rootLogger = lc.getLogger(Logger.ROOT_LOGGER_NAME);
|
||||
rootLogger.addAppender(ca);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
com.ruoyi.common.job.config.PowerJobConfig
|
||||
com.ruoyi.common.job.config.EasyRetryConfig
|
@ -15,6 +15,7 @@
|
||||
<modules>
|
||||
<module>ruoyi-monitor</module>
|
||||
<module>ruoyi-powerjob-server</module>
|
||||
<module>ruoyi-easyretry-server</module>
|
||||
</modules>
|
||||
|
||||
</project>
|
||||
|
18
ruoyi-extra/ruoyi-easyretry-server/Dockerfile
Normal file
18
ruoyi-extra/ruoyi-easyretry-server/Dockerfile
Normal file
@ -0,0 +1,18 @@
|
||||
# 使用官方的 Java 运行时作为父镜像
|
||||
FROM registry.cn-qingdao.aliyuncs.com/yuzl1/jdk:21
|
||||
|
||||
MAINTAINER Lion Li
|
||||
|
||||
RUN mkdir -p /ruoyi/easyretry/logs
|
||||
|
||||
WORKDIR /ruoyi/easyretry
|
||||
|
||||
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS="-Xms512m -Xmx1024m"
|
||||
|
||||
EXPOSE 8800
|
||||
EXPOSE 1788
|
||||
|
||||
ADD ./target/ruoyi-easyretry-server.jar ./app.jar
|
||||
|
||||
ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom -jar app.jar \
|
||||
-XX:+HeapDumpOnOutOfMemoryError -Xlog:gc*,:time,tags,level -XX:+UseZGC ${JAVA_OPTS}
|
46
ruoyi-extra/ruoyi-easyretry-server/pom.xml
Normal file
46
ruoyi-extra/ruoyi-easyretry-server/pom.xml
Normal file
@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-extra</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<packaging>jar</packaging>
|
||||
<artifactId>ruoyi-easyretry-server</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.aizuda</groupId>
|
||||
<artifactId>easy-retry-server-starter</artifactId>
|
||||
<version>${easyretry.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>de.codecentric</groupId>
|
||||
<artifactId>spring-boot-admin-starter-client</artifactId>
|
||||
<version>${spring-boot-admin.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>${spring-boot.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
@ -0,0 +1,18 @@
|
||||
package com.ruoyi.easyretry;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* EasyRetry Server 启动程序
|
||||
*
|
||||
* @author dhb52
|
||||
*/
|
||||
@SpringBootApplication
|
||||
public class EasyRetryServerApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(com.aizuda.easy.retry.server.EasyRetryServerApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
spring:
|
||||
datasource:
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://localhost:3306/ruoyi-flex?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: Root@369
|
||||
hikari:
|
||||
connection-timeout: 30000
|
||||
validation-timeout: 5000
|
||||
minimum-idle: 10
|
||||
maximum-pool-size: 20
|
||||
idle-timeout: 600000
|
||||
max-lifetime: 900000
|
||||
keepaliveTime: 30000
|
||||
|
||||
--- # easy-retry 服务端配置
|
||||
easy-retry:
|
||||
# 拉取重试数据的每批次的大小
|
||||
retry-pull-page-size: 1000
|
||||
# 拉取重试数据的每批次的大小
|
||||
job-pull-page-size: 1000
|
||||
# 服务端 netty 端口
|
||||
netty-port: 1788
|
||||
# 重试和死信表的分区总数
|
||||
total-partition: 2
|
||||
# 一个客户端每秒最多接收的重试数量指令
|
||||
limiter: 1000
|
||||
# 号段模式下步长配置
|
||||
step: 100
|
||||
# 日志保存时间(单位: day)
|
||||
log-storage: 90
|
||||
# 回调配置
|
||||
callback:
|
||||
#回调最大执行次数
|
||||
max-count: 288
|
||||
#间隔时间
|
||||
trigger-interval: 900
|
||||
mode: all
|
||||
retry-max-pull-count: 10
|
||||
|
||||
--- # 监控中心配置
|
||||
spring.boot.admin.client:
|
||||
# 增加客户端开关
|
||||
enabled: true
|
||||
url: http://localhost:9090/admin
|
||||
instance:
|
||||
service-host-type: IP
|
||||
username: ruoyi
|
||||
password: 123456
|
@ -0,0 +1,50 @@
|
||||
spring:
|
||||
datasource:
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://localhost:3306/ruoyi-flex?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: Root@369
|
||||
hikari:
|
||||
connection-timeout: 30000
|
||||
validation-timeout: 5000
|
||||
minimum-idle: 10
|
||||
maximum-pool-size: 20
|
||||
idle-timeout: 600000
|
||||
max-lifetime: 900000
|
||||
keepaliveTime: 30000
|
||||
|
||||
--- # easy-retry 服务端配置
|
||||
easy-retry:
|
||||
# 拉取重试数据的每批次的大小
|
||||
retry-pull-page-size: 1000
|
||||
# 拉取重试数据的每批次的大小
|
||||
job-pull-page-size: 1000
|
||||
# 服务端 netty 端口
|
||||
netty-port: 1788
|
||||
# 重试和死信表的分区总数
|
||||
total-partition: 2
|
||||
# 一个客户端每秒最多接收的重试数量指令
|
||||
limiter: 1000
|
||||
# 号段模式下步长配置
|
||||
step: 100
|
||||
# 日志保存时间(单位: day)
|
||||
log-storage: 90
|
||||
# 回调配置
|
||||
callback:
|
||||
#回调最大执行次数
|
||||
max-count: 288
|
||||
#间隔时间
|
||||
trigger-interval: 900
|
||||
mode: all
|
||||
retry-max-pull-count: 10
|
||||
|
||||
--- # 监控中心配置
|
||||
spring.boot.admin.client:
|
||||
# 增加客户端开关
|
||||
enabled: true
|
||||
url: http://localhost:9090/admin
|
||||
instance:
|
||||
service-host-type: IP
|
||||
username: ruoyi
|
||||
password: 123456
|
@ -0,0 +1,40 @@
|
||||
server:
|
||||
port: 8800
|
||||
servlet:
|
||||
context-path: /easy-retry
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: ruoyi-easyretry-server
|
||||
profiles:
|
||||
active: @profiles.active@
|
||||
web:
|
||||
resources:
|
||||
static-locations: classpath:admin/
|
||||
|
||||
mybatis-plus:
|
||||
typeAliasesPackage: com.aizuda.easy.retry.template.datasource.persistence.po
|
||||
global-config:
|
||||
db-config:
|
||||
table-prefix: er_
|
||||
where-strategy: NOT_EMPTY
|
||||
capital-mode: false
|
||||
logic-delete-value: 1
|
||||
logic-not-delete-value: 0
|
||||
configuration:
|
||||
map-underscore-to-camel-case: true
|
||||
cache-enabled: true
|
||||
|
||||
logging:
|
||||
config: classpath:logback-plus.xml
|
||||
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: '*'
|
||||
endpoint:
|
||||
health:
|
||||
show-details: ALWAYS
|
||||
logfile:
|
||||
external-file: ./logs/ruoyi-easyretry-server/console.log
|
@ -0,0 +1,92 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<property name="log.path" value="./logs/ruoyi-easyretry-server" />
|
||||
<property name="console.log.pattern"
|
||||
value="%red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}%n) - %msg%n"/>
|
||||
<property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"/>
|
||||
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${console.log.pattern}</pattern>
|
||||
<charset>utf-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="file_console" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/console.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/console.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大 1天 -->
|
||||
<maxHistory>1</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
<charset>utf-8</charset>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<FileNamePattern>${log.base}/info.%d{yyyy-MM-dd}.log</FileNamePattern>
|
||||
<MaxHistory>60</MaxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>INFO</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<FileNamePattern>${log.base}/error.%d{yyyy-MM-dd}.log
|
||||
</FileNamePattern>
|
||||
<MaxHistory>60</MaxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>ERROR</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name ="async_info" class= "ch.qos.logback.classic.AsyncAppender">
|
||||
<discardingThreshold >100</discardingThreshold>
|
||||
<queueSize>1024</queueSize>
|
||||
<appender-ref ref ="file_info"/>
|
||||
</appender>
|
||||
|
||||
<appender name ="async_error" class= "ch.qos.logback.classic.AsyncAppender">
|
||||
<discardingThreshold >100</discardingThreshold>
|
||||
<queueSize>1024</queueSize>
|
||||
<appender-ref ref ="file_error"/>
|
||||
</appender>
|
||||
|
||||
<!-- EasyRetry appender -->
|
||||
<appender name="easy_log_server_appender" class="com.aizuda.easy.retry.server.common.appender.EasyRetryServerLogbackAppender">
|
||||
</appender>
|
||||
|
||||
<!-- 控制台输出日志级别 -->
|
||||
<root level="info">
|
||||
<appender-ref ref="console" />
|
||||
<appender-ref ref="async_info" />
|
||||
<appender-ref ref="async_error" />
|
||||
<appender-ref ref="easy_log_server_appender" />
|
||||
</root>
|
||||
</configuration>
|
@ -2,15 +2,15 @@ oms.env=dev
|
||||
|
||||
####### Database properties(Configure according to the the environment) #######
|
||||
spring.datasource.remote.hibernate.properties.hibernate.dialect=tech.powerjob.server.persistence.config.dialect.PowerJobPGDialect
|
||||
spring.datasource.core.driver-class-name=org.postgresql.Driver
|
||||
spring.datasource.core.jdbc-url=jdbc:postgresql://localhost:5432/ruoyi-flex?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
spring.datasource.core.username=root
|
||||
spring.datasource.core.password=root
|
||||
#spring.datasource.core.driver-class-name=org.postgresql.Driver
|
||||
#spring.datasource.core.jdbc-url=jdbc:postgresql://localhost:5432/ruoyi-flex?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
#spring.datasource.core.username=postgres
|
||||
#spring.datasource.core.password=postgres@369
|
||||
## MySQL数据库连接参数
|
||||
#spring.datasource.core.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
#spring.datasource.core.jdbc-url=jdbc:mysql://localhost:3306/ruoyi-flex?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
#spring.datasource.core.username=root
|
||||
#spring.datasource.core.password=Root@369
|
||||
spring.datasource.core.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.core.jdbc-url=jdbc:mysql://localhost:3306/ruoyi-flex?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
spring.datasource.core.username=root
|
||||
spring.datasource.core.password=Root@369
|
||||
spring.datasource.core.maximum-pool-size=20
|
||||
spring.datasource.core.minimum-idle=5
|
||||
|
||||
|
@ -2,10 +2,15 @@ oms.env=prod
|
||||
|
||||
####### Database properties(Configure according to the the environment) #######
|
||||
spring.datasource.remote.hibernate.properties.hibernate.dialect=tech.powerjob.server.persistence.config.dialect.PowerJobPGDialect
|
||||
spring.datasource.core.driver-class-name=org.postgresql.Driver
|
||||
spring.datasource.core.jdbc-url=jdbc:postgresql://rm-cn-em93orkmv001b83o.rwlb.rds.aliyuncs.com:5432/ruoyi-flex?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
spring.datasource.core.username=root_pg
|
||||
spring.datasource.core.password=Yzl@1998
|
||||
#spring.datasource.core.driver-class-name=org.postgresql.Driver
|
||||
#spring.datasource.core.jdbc-url=jdbc:postgresql://localhost:5432/ruoyi-flex?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
#spring.datasource.core.username=postgres
|
||||
#spring.datasource.core.password=postgres@369
|
||||
## MySQL数据库连接参数
|
||||
spring.datasource.core.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.core.jdbc-url=jdbc:mysql://localhost:3306/ruoyi-flex?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
spring.datasource.core.username=root
|
||||
spring.datasource.core.password=Root@369
|
||||
spring.datasource.core.maximum-pool-size=20
|
||||
spring.datasource.core.minimum-idle=5
|
||||
|
||||
@ -13,7 +18,7 @@ spring.datasource.core.minimum-idle=5
|
||||
# 客户端开关
|
||||
spring.boot.admin.client.enabled=true
|
||||
# 设置 Spring Boot Admin Server 地址
|
||||
spring.boot.admin.client.url: http://172.16.0.151:9090/admin
|
||||
spring.boot.admin.client.url: http://localhost:9090/admin
|
||||
spring.boot.admin.client.instance.service-host-type=IP
|
||||
spring.boot.admin.client.username=ruoyi
|
||||
spring.boot.admin.client.password=123456
|
||||
|
@ -0,0 +1,23 @@
|
||||
package com.ruoyi.job.easyretry;
|
||||
|
||||
import com.aizuda.easy.retry.client.job.core.annotation.JobExecutor;
|
||||
import com.aizuda.easy.retry.client.job.core.dto.JobArgs;
|
||||
import com.aizuda.easy.retry.client.model.ExecuteResult;
|
||||
import com.aizuda.easy.retry.common.core.util.JsonUtil;
|
||||
import com.aizuda.easy.retry.common.log.EasyRetryLog;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author www.byteblogs.com
|
||||
* @date 2023-09-28 22:54:07
|
||||
*/
|
||||
@Component
|
||||
@JobExecutor(name = "testJobExecutor")
|
||||
public class TestAnnoJobExecutor {
|
||||
|
||||
public ExecuteResult jobExecute(JobArgs jobArgs) {
|
||||
EasyRetryLog.LOCAL.info("testJobExecutor. jobArgs:{}", JsonUtil.toJsonString(jobArgs));
|
||||
EasyRetryLog.REMOTE.info("testJobExecutor. jobArgs:{}", JsonUtil.toJsonString(jobArgs));
|
||||
return ExecuteResult.success("测试成功");
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.ruoyi.job.easyretry;
|
||||
|
||||
import com.aizuda.easy.retry.client.job.core.dto.JobArgs;
|
||||
import com.aizuda.easy.retry.client.job.core.executor.AbstractJobExecutor;
|
||||
import com.aizuda.easy.retry.client.model.ExecuteResult;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author www.byteblogs.com
|
||||
* @date 2023-09-28 22:54:07
|
||||
*/
|
||||
@Component
|
||||
public class TestClassJobExecutor extends AbstractJobExecutor {
|
||||
|
||||
@Override
|
||||
protected ExecuteResult doJobExecute(JobArgs jobArgs) {
|
||||
return ExecuteResult.success("TestJobExecutor测试成功");
|
||||
}
|
||||
}
|
525
script/sql/mysql/easy_retry.sql
Normal file
525
script/sql/mysql/easy_retry.sql
Normal file
@ -0,0 +1,525 @@
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
CREATE TABLE `er_namespace`
|
||||
(
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`name` varchar(64) NOT NULL COMMENT '名称',
|
||||
`unique_id` varchar(64) NOT NULL COMMENT '唯一id',
|
||||
`description` varchar(256) NOT NULL DEFAULT '' COMMENT '描述',
|
||||
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
`deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT '逻辑删除 1、删除',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_name` (`name`),
|
||||
UNIQUE KEY `uk_unique_id` (`unique_id`)
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='命名空间';
|
||||
|
||||
INSERT INTO `er_namespace` VALUES (1, 'Development', 'dev', '', now(), now(), 0);
|
||||
INSERT INTO `er_namespace` VALUES (2, 'Production', 'prod', '', now(), now(), 0);
|
||||
|
||||
|
||||
CREATE TABLE `er_group_config`
|
||||
(
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
|
||||
`group_name` varchar(64) NOT NULL DEFAULT '' COMMENT '组名称',
|
||||
`description` varchar(256) NOT NULL DEFAULT '' COMMENT '组描述',
|
||||
`token` varchar(64) NOT NULL DEFAULT 'ER_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT' COMMENT 'token',
|
||||
`group_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '组状态 0、未启用 1、启用',
|
||||
`version` int(11) NOT NULL COMMENT '版本号',
|
||||
`group_partition` int(11) NOT NULL COMMENT '分区',
|
||||
`id_generator_mode` tinyint(4) NOT NULL DEFAULT '1' COMMENT '唯一id生成模式 默认号段模式',
|
||||
`init_scene` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否初始化场景 0:否 1:是',
|
||||
`bucket_index` int(11) NOT NULL DEFAULT '0' COMMENT 'bucket',
|
||||
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_namespace_id_group_name` (`namespace_id`, `group_name`)
|
||||
) ENGINE = InnoDB
|
||||
AUTO_INCREMENT = 0
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='组配置'
|
||||
;
|
||||
|
||||
INSERT INTO `er_group_config` VALUES (1, 'dev', 'ruoyi_group', '', 'ER_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT', 1, 1, 0, 1, 1, 4, now(), now());
|
||||
|
||||
|
||||
CREATE TABLE `er_notify_config`
|
||||
(
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
|
||||
`group_name` varchar(64) NOT NULL COMMENT '组名称',
|
||||
`scene_name` varchar(64) NOT NULL COMMENT '场景名称',
|
||||
`notify_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '通知状态 0、未启用 1、启用',
|
||||
`notify_type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '通知类型 1、钉钉 2、邮件 3、企业微信',
|
||||
`notify_attribute` varchar(512) NOT NULL COMMENT '配置属性',
|
||||
`notify_threshold` int(11) NOT NULL DEFAULT '0' COMMENT '通知阈值',
|
||||
`notify_scene` tinyint(4) NOT NULL DEFAULT '0' COMMENT '通知场景',
|
||||
`rate_limiter_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '限流状态 0、未启用 1、启用',
|
||||
`rate_limiter_threshold` int(11) NOT NULL DEFAULT '0' COMMENT '每秒限流阈值',
|
||||
`description` varchar(256) NOT NULL DEFAULT '' COMMENT '描述',
|
||||
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_namespace_id_group_name_scene_name` (`namespace_id`, `group_name`, `scene_name`)
|
||||
) ENGINE = InnoDB
|
||||
AUTO_INCREMENT = 0
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='通知配置'
|
||||
;
|
||||
|
||||
CREATE TABLE `er_retry_dead_letter_0`
|
||||
(
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
|
||||
`unique_id` varchar(64) NOT NULL COMMENT '同组下id唯一',
|
||||
`group_name` varchar(64) NOT NULL COMMENT '组名称',
|
||||
`scene_name` varchar(64) NOT NULL COMMENT '场景名称',
|
||||
`idempotent_id` varchar(64) NOT NULL COMMENT '幂等id',
|
||||
`biz_no` varchar(64) NOT NULL DEFAULT '' COMMENT '业务编号',
|
||||
`executor_name` varchar(512) NOT NULL DEFAULT '' COMMENT '执行器名称',
|
||||
`args_str` text NOT NULL COMMENT '执行方法参数',
|
||||
`ext_attrs` text NOT NULL COMMENT '扩展字段',
|
||||
`task_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '任务类型 1、重试数据 2、回调数据',
|
||||
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_namespace_id_group_name_scene_name` (`namespace_id`, `group_name`, `scene_name`),
|
||||
KEY `idx_idempotent_id` (`idempotent_id`),
|
||||
KEY `idx_biz_no` (`biz_no`),
|
||||
KEY `idx_create_dt` (`create_dt`),
|
||||
UNIQUE KEY `uk_namespace_id_group_name_unique_id` (`namespace_id`, `group_name`, `unique_id`)
|
||||
) ENGINE = InnoDB
|
||||
AUTO_INCREMENT = 0
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='死信队列表'
|
||||
;
|
||||
|
||||
CREATE TABLE `er_retry_task_0`
|
||||
(
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
|
||||
`unique_id` varchar(64) NOT NULL COMMENT '同组下id唯一',
|
||||
`group_name` varchar(64) NOT NULL COMMENT '组名称',
|
||||
`scene_name` varchar(64) NOT NULL COMMENT '场景名称',
|
||||
`idempotent_id` varchar(64) NOT NULL COMMENT '幂等id',
|
||||
`biz_no` varchar(64) NOT NULL DEFAULT '' COMMENT '业务编号',
|
||||
`executor_name` varchar(512) NOT NULL DEFAULT '' COMMENT '执行器名称',
|
||||
`args_str` text NOT NULL COMMENT '执行方法参数',
|
||||
`ext_attrs` text NOT NULL COMMENT '扩展字段',
|
||||
`next_trigger_at` datetime NOT NULL COMMENT '下次触发时间',
|
||||
`retry_count` int(11) NOT NULL DEFAULT '0' COMMENT '重试次数',
|
||||
`retry_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '重试状态 0、重试中 1、成功 2、最大重试次数',
|
||||
`task_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '任务类型 1、重试数据 2、回调数据',
|
||||
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_namespace_id_group_name_scene_name` (`namespace_id`, `group_name`, `scene_name`),
|
||||
KEY `idx_namespace_id_group_name_task_type` (`namespace_id`, `group_name`, `task_type`),
|
||||
KEY `idx_namespace_id_group_name_retry_status` (`namespace_id`, `group_name`, `retry_status`),
|
||||
KEY `idx_idempotent_id` (`idempotent_id`),
|
||||
KEY `idx_biz_no` (`biz_no`),
|
||||
KEY `idx_create_dt` (`create_dt`),
|
||||
UNIQUE KEY `uk_name_unique_id` (`namespace_id`, `group_name`, `unique_id`)
|
||||
) ENGINE = InnoDB
|
||||
AUTO_INCREMENT = 0
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='任务表'
|
||||
;
|
||||
|
||||
CREATE TABLE `er_retry_task_log`
|
||||
(
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
|
||||
`unique_id` varchar(64) NOT NULL COMMENT '同组下id唯一',
|
||||
`group_name` varchar(64) NOT NULL COMMENT '组名称',
|
||||
`scene_name` varchar(64) NOT NULL COMMENT '场景名称',
|
||||
`idempotent_id` varchar(64) NOT NULL COMMENT '幂等id',
|
||||
`biz_no` varchar(64) NOT NULL DEFAULT '' COMMENT '业务编号',
|
||||
`executor_name` varchar(512) NOT NULL DEFAULT '' COMMENT '执行器名称',
|
||||
`args_str` text NOT NULL COMMENT '执行方法参数',
|
||||
`ext_attrs` text NOT NULL COMMENT '扩展字段',
|
||||
`retry_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '重试状态 0、重试中 1、成功 2、最大次数',
|
||||
`task_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '任务类型 1、重试数据 2、回调数据',
|
||||
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_group_name_scene_name` (`namespace_id`, `group_name`, `scene_name`),
|
||||
KEY `idx_retry_status` (`retry_status`),
|
||||
KEY `idx_idempotent_id` (`idempotent_id`),
|
||||
KEY `idx_unique_id` (`unique_id`),
|
||||
KEY `idx_biz_no` (`biz_no`),
|
||||
KEY `idx_create_dt` (`create_dt`)
|
||||
) ENGINE = InnoDB
|
||||
AUTO_INCREMENT = 0
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='任务日志基础信息表'
|
||||
;
|
||||
|
||||
CREATE TABLE `er_retry_task_log_message`
|
||||
(
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
|
||||
`group_name` varchar(64) NOT NULL COMMENT '组名称',
|
||||
`unique_id` varchar(64) NOT NULL COMMENT '同组下id唯一',
|
||||
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`message` longtext NOT NULL COMMENT '异常信息',
|
||||
`log_num` int(11) NOT NULL DEFAULT 1 COMMENT '日志数量',
|
||||
`real_time` bigint(13) NOT NULL DEFAULT 0 COMMENT '上报时间',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_namespace_id_group_name_scene_name` (`namespace_id`, `group_name`, `unique_id`),
|
||||
KEY `idx_create_dt` (`create_dt`)
|
||||
) ENGINE = InnoDB
|
||||
AUTO_INCREMENT = 0
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='任务调度日志信息记录表'
|
||||
;
|
||||
|
||||
CREATE TABLE `er_scene_config`
|
||||
(
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
|
||||
`scene_name` varchar(64) NOT NULL COMMENT '场景名称',
|
||||
`group_name` varchar(64) NOT NULL COMMENT '组名称',
|
||||
`scene_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '组状态 0、未启用 1、启用',
|
||||
`max_retry_count` int(11) NOT NULL DEFAULT '5' COMMENT '最大重试次数',
|
||||
`back_off` tinyint(4) NOT NULL DEFAULT '1' COMMENT '1、默认等级 2、固定间隔时间 3、CRON 表达式',
|
||||
`trigger_interval` varchar(16) NOT NULL DEFAULT '' COMMENT '间隔时长',
|
||||
`deadline_request` bigint(20) unsigned NOT NULL DEFAULT '60000' COMMENT 'Deadline Request 调用链超时 单位毫秒',
|
||||
`executor_timeout` int(11) unsigned NOT NULL DEFAULT '5' COMMENT '任务执行超时时间,单位秒',
|
||||
`route_key` tinyint(4) NOT NULL DEFAULT '4' COMMENT '路由策略',
|
||||
`description` varchar(256) NOT NULL DEFAULT '' COMMENT '描述',
|
||||
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_namespace_id_group_name_scene_name` (`namespace_id`, `group_name`, `scene_name`)
|
||||
) ENGINE = InnoDB
|
||||
AUTO_INCREMENT = 0
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='场景配置'
|
||||
;
|
||||
|
||||
CREATE TABLE `er_server_node`
|
||||
(
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
|
||||
`group_name` varchar(64) NOT NULL COMMENT '组名称',
|
||||
`host_id` varchar(64) NOT NULL COMMENT '主机id',
|
||||
`host_ip` varchar(64) NOT NULL COMMENT '机器ip',
|
||||
`context_path` varchar(256) NOT NULL DEFAULT '/' COMMENT '客户端上下文路径 server.servlet.context-path',
|
||||
`host_port` int(16) NOT NULL COMMENT '机器端口',
|
||||
`expire_at` datetime NOT NULL COMMENT '过期时间',
|
||||
`node_type` tinyint(4) NOT NULL COMMENT '节点类型 1、客户端 2、是服务端',
|
||||
`ext_attrs` varchar(256) NULL default '' COMMENT '扩展字段',
|
||||
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_namespace_id_group_name` (`namespace_id`, `group_name`),
|
||||
KEY `idx_expire_at_node_type` (`expire_at`, `node_type`),
|
||||
UNIQUE KEY `uk_host_id_host_ip` (`host_id`, `host_ip`)
|
||||
) ENGINE = InnoDB
|
||||
AUTO_INCREMENT = 0
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='服务器节点'
|
||||
;
|
||||
|
||||
CREATE TABLE `er_distributed_lock`
|
||||
(
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`name` varchar(64) NOT NULL COMMENT '锁名称',
|
||||
`lock_until` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3) COMMENT '锁定时长',
|
||||
`locked_at` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '锁定时间',
|
||||
`locked_by` varchar(255) NOT NULL COMMENT '锁定者',
|
||||
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_name` (`name`)
|
||||
) ENGINE = InnoDB
|
||||
AUTO_INCREMENT = 0
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='锁定表'
|
||||
;
|
||||
|
||||
CREATE TABLE `er_system_user`
|
||||
(
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`username` varchar(64) NOT NULL COMMENT '账号',
|
||||
`password` varchar(128) NOT NULL COMMENT '密码',
|
||||
`role` tinyint(4) NOT NULL DEFAULT '0' COMMENT '角色:1-普通用户、2-管理员',
|
||||
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_username` (`username`) USING BTREE
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='系统用户表';
|
||||
|
||||
-- pwd: admin
|
||||
INSERT INTO `er_system_user` VALUES (1, 'admin', '465c194afb65670f38322df087f0a9bb225cc257e43eb4ac5a0c98ef5b3173ac', 2, now(), now());
|
||||
|
||||
CREATE TABLE `er_system_user_permission`
|
||||
(
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`group_name` varchar(64) NOT NULL COMMENT '组名称',
|
||||
`namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
|
||||
`system_user_id` bigint(20) NOT NULL COMMENT '系统用户id',
|
||||
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_namespace_id_group_name_system_user_id` (`namespace_id`, `group_name`, `system_user_id`)
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='系统用户权限表';
|
||||
|
||||
CREATE TABLE `er_sequence_alloc`
|
||||
(
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
|
||||
`group_name` varchar(64) NOT NULL DEFAULT '' COMMENT '组名称',
|
||||
`max_id` bigint(20) NOT NULL DEFAULT '1' COMMENT '最大id',
|
||||
`step` int(11) NOT NULL DEFAULT '100' COMMENT '步长',
|
||||
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_namespace_id_group_name` (`namespace_id`, `group_name`)
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='号段模式序号ID分配表';
|
||||
|
||||
-- 分布式调度DDL
|
||||
CREATE TABLE `er_job`
|
||||
(
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
|
||||
`group_name` varchar(64) NOT NULL COMMENT '组名称',
|
||||
`job_name` varchar(64) NOT NULL COMMENT '名称',
|
||||
`args_str` text DEFAULT NULL COMMENT '执行方法参数',
|
||||
`args_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '参数类型 ',
|
||||
`next_trigger_at` bigint(13) NOT NULL COMMENT '下次触发时间',
|
||||
`job_status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '任务状态 0、关闭、1、开启',
|
||||
`task_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '任务类型 1、集群 2、广播 3、切片',
|
||||
`route_key` tinyint(4) NOT NULL DEFAULT '4' COMMENT '路由策略',
|
||||
`executor_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '执行器类型',
|
||||
`executor_info` varchar(255) DEFAULT NULL COMMENT '执行器名称',
|
||||
`trigger_type` tinyint(4) NOT NULL COMMENT '触发类型 1.CRON 表达式 2. 固定时间',
|
||||
`trigger_interval` varchar(255) NOT NULL COMMENT '间隔时长',
|
||||
`block_strategy` tinyint(4) NOT NULL DEFAULT '1' COMMENT '阻塞策略 1、丢弃 2、覆盖 3、并行',
|
||||
`executor_timeout` int(11) NOT NULL DEFAULT '0' COMMENT '任务执行超时时间,单位秒',
|
||||
`max_retry_times` int(11) NOT NULL DEFAULT '0' COMMENT '最大重试次数',
|
||||
`parallel_num` int(11) NOT NULL DEFAULT '1' COMMENT '并行数',
|
||||
`retry_interval` int(11) NOT NULL DEFAULT '0' COMMENT '重试间隔(s)',
|
||||
`bucket_index` int(11) NOT NULL DEFAULT '0' COMMENT 'bucket',
|
||||
`resident` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否是常驻任务',
|
||||
`description` varchar(256) NOT NULL DEFAULT '' COMMENT '描述',
|
||||
`ext_attrs` varchar(256) NULL default '' COMMENT '扩展字段',
|
||||
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
`deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT '逻辑删除 1、删除',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_namespace_id_group_name` (`namespace_id`, `group_name`),
|
||||
KEY `idx_job_status_bucket_index` (`job_status`, `bucket_index`),
|
||||
KEY `idx_create_dt` (`create_dt`)
|
||||
) ENGINE = InnoDB
|
||||
AUTO_INCREMENT = 0
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='任务信息';
|
||||
|
||||
CREATE TABLE `er_job_log_message`
|
||||
(
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
|
||||
`group_name` varchar(64) NOT NULL COMMENT '组名称',
|
||||
`job_id` bigint(20) NOT NULL COMMENT '任务信息id',
|
||||
`task_batch_id` bigint(20) NOT NULL COMMENT '任务批次id',
|
||||
`task_id` bigint(20) NOT NULL COMMENT '调度任务id',
|
||||
`message` longtext NOT NULL COMMENT '调度信息',
|
||||
`log_num` int(11) NOT NULL DEFAULT 1 COMMENT '日志数量',
|
||||
`real_time` bigint(13) NOT NULL DEFAULT 0 COMMENT '上报时间',
|
||||
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`ext_attrs` varchar(256) NULL default '' COMMENT '扩展字段',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_task_batch_id_task_id` (`task_batch_id`, `task_id`),
|
||||
KEY `idx_create_dt` (`create_dt`),
|
||||
KEY `idx_namespace_id_group_name` (`namespace_id`, `group_name`)
|
||||
) ENGINE = InnoDB
|
||||
AUTO_INCREMENT = 0
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='调度日志';
|
||||
|
||||
CREATE TABLE `er_job_task`
|
||||
(
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
|
||||
`group_name` varchar(64) NOT NULL COMMENT '组名称',
|
||||
`job_id` bigint(20) NOT NULL COMMENT '任务信息id',
|
||||
`task_batch_id` bigint(20) NOT NULL COMMENT '调度任务id',
|
||||
`parent_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '父执行器id',
|
||||
`task_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '执行的状态 0、失败 1、成功',
|
||||
`retry_count` int(11) NOT NULL DEFAULT '0' COMMENT '重试次数',
|
||||
`client_info` varchar(128) DEFAULT NULL COMMENT '客户端地址 clientId#ip:port',
|
||||
`result_message` text NOT NULL COMMENT '执行结果',
|
||||
`args_str` text DEFAULT NULL COMMENT '执行方法参数',
|
||||
`args_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '参数类型 ',
|
||||
`ext_attrs` varchar(256) NULL default '' COMMENT '扩展字段',
|
||||
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_task_batch_id_task_status` (`task_batch_id`, `task_status`),
|
||||
KEY `idx_create_dt` (`create_dt`),
|
||||
KEY `idx_namespace_id_group_name` (`namespace_id`, `group_name`)
|
||||
) ENGINE = InnoDB
|
||||
AUTO_INCREMENT = 0
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='任务实例';
|
||||
|
||||
CREATE TABLE `er_job_task_batch`
|
||||
(
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
|
||||
`group_name` varchar(64) NOT NULL COMMENT '组名称',
|
||||
`job_id` bigint(20) NOT NULL COMMENT '任务id',
|
||||
`workflow_node_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '工作流节点id',
|
||||
`parent_workflow_node_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '工作流任务父批次id',
|
||||
`workflow_task_batch_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '工作流任务批次id',
|
||||
`task_batch_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '任务批次状态 0、失败 1、成功',
|
||||
`operation_reason` tinyint(4) NOT NULL DEFAULT '0' COMMENT '操作原因',
|
||||
`execution_at` bigint(13) NOT NULL DEFAULT '0' COMMENT '任务执行时间',
|
||||
`system_task_type` tinyint(4) NOT NULL DEFAULT '3' COMMENT '任务类型 3、JOB任务 4、WORKFLOW任务',
|
||||
`parent_id` varchar(64) NOT NULL DEFAULT '' COMMENT '父节点',
|
||||
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
`deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT '逻辑删除 1、删除',
|
||||
`ext_attrs` varchar(256) NULL default '' COMMENT '扩展字段',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_job_id_task_batch_status` (`job_id`, `task_batch_status`),
|
||||
KEY `idx_create_dt` (`create_dt`),
|
||||
KEY `idx_namespace_id_group_name` (`namespace_id`, `group_name`),
|
||||
KEY `idx_workflow_task_batch_id_workflow_node_id` (`workflow_task_batch_id`, `workflow_node_id`)
|
||||
) ENGINE = InnoDB
|
||||
AUTO_INCREMENT = 0
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='任务批次';
|
||||
|
||||
CREATE TABLE `er_job_notify_config`
|
||||
(
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
|
||||
`group_name` varchar(64) NOT NULL COMMENT '组名称',
|
||||
`job_id` bigint(20) NOT NULL COMMENT '任务id',
|
||||
`notify_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '通知状态 0、未启用 1、启用',
|
||||
`notify_type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '通知类型 1、钉钉 2、邮件 3、企业微信',
|
||||
`notify_attribute` varchar(512) NOT NULL COMMENT '配置属性',
|
||||
`notify_threshold` int(11) NOT NULL DEFAULT '0' COMMENT '通知阈值',
|
||||
`notify_scene` tinyint(4) NOT NULL DEFAULT '0' COMMENT '通知场景',
|
||||
`rate_limiter_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '限流状态 0、未启用 1、启用',
|
||||
`rate_limiter_threshold` int(11) NOT NULL DEFAULT '0' COMMENT '每秒限流阈值',
|
||||
`description` varchar(256) NOT NULL DEFAULT '' COMMENT '描述',
|
||||
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_namespace_id_group_name_job_id` (`namespace_id`, `group_name`, job_id)
|
||||
) ENGINE = InnoDB
|
||||
AUTO_INCREMENT = 4
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='job通知配置';
|
||||
|
||||
CREATE TABLE `er_job_summary`
|
||||
(
|
||||
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`namespace_id` VARCHAR(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
|
||||
`group_name` VARCHAR(64) NOT NULL DEFAULT '' COMMENT '组名称',
|
||||
`business_id` bigint NOT NULL COMMENT '业务id (job_id或workflow_id)',
|
||||
`system_task_type` tinyint(4) NOT NULL DEFAULT '3' COMMENT '任务类型 3、JOB任务 4、WORKFLOW任务',
|
||||
`trigger_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '统计时间',
|
||||
`success_num` int NOT NULL DEFAULT '0' COMMENT '执行成功-日志数量',
|
||||
`fail_num` int NOT NULL DEFAULT '0' COMMENT '执行失败-日志数量',
|
||||
`fail_reason` varchar(512) NOT NULL DEFAULT '' COMMENT '失败原因',
|
||||
`stop_num` int NOT NULL DEFAULT '0' COMMENT '执行失败-日志数量',
|
||||
`stop_reason` varchar(512) NOT NULL DEFAULT '' COMMENT '失败原因',
|
||||
`cancel_num` int NOT NULL DEFAULT '0' COMMENT '执行失败-日志数量',
|
||||
`cancel_reason` varchar(512) NOT NULL DEFAULT '' COMMENT '失败原因',
|
||||
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_namespace_id_group_name_business_id` (`namespace_id`, `group_name`, business_id),
|
||||
UNIQUE KEY `uk_trigger_at_system_task_type_business_id` (`trigger_at`, `system_task_type`, `business_id`) USING BTREE
|
||||
) ENGINE = InnoDB
|
||||
AUTO_INCREMENT = 1
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='DashBoard_Job';
|
||||
|
||||
CREATE TABLE `er_retry_summary`
|
||||
(
|
||||
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`namespace_id` VARCHAR(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
|
||||
`group_name` VARCHAR(64) NOT NULL DEFAULT '' COMMENT '组名称',
|
||||
`scene_name` VARCHAR(50) NOT NULL DEFAULT '' COMMENT '场景名称',
|
||||
`trigger_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '统计时间',
|
||||
`running_num` int NOT NULL DEFAULT '0' COMMENT '重试中-日志数量',
|
||||
`finish_num` int NOT NULL DEFAULT '0' COMMENT '重试完成-日志数量',
|
||||
`max_count_num` int NOT NULL DEFAULT '0' COMMENT '重试到达最大次数-日志数量',
|
||||
`suspend_num` int NOT NULL DEFAULT '0' COMMENT '暂停重试-日志数量',
|
||||
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_trigger_at` (`trigger_at`),
|
||||
UNIQUE KEY `uk_scene_name_trigger_at` (`namespace_id`, `group_name`, `scene_name`, `trigger_at`) USING BTREE
|
||||
) ENGINE = InnoDB
|
||||
AUTO_INCREMENT = 1
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='DashBoard_Retry';
|
||||
|
||||
CREATE TABLE `er_workflow`
|
||||
(
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`workflow_name` varchar(64) NOT NULL COMMENT '工作流名称',
|
||||
`namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
|
||||
`group_name` varchar(64) NOT NULL COMMENT '组名称',
|
||||
`workflow_status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '工作流状态 0、关闭、1、开启',
|
||||
`trigger_type` tinyint(4) NOT NULL COMMENT '触发类型 1.CRON 表达式 2. 固定时间',
|
||||
`trigger_interval` varchar(255) NOT NULL COMMENT '间隔时长',
|
||||
`next_trigger_at` bigint(13) NOT NULL COMMENT '下次触发时间',
|
||||
`block_strategy` tinyint(4) NOT NULL DEFAULT '1' COMMENT '阻塞策略 1、丢弃 2、覆盖 3、并行',
|
||||
`executor_timeout` int(11) NOT NULL DEFAULT '0' COMMENT '任务执行超时时间,单位秒',
|
||||
`description` varchar(256) NOT NULL DEFAULT '' COMMENT '描述',
|
||||
`flow_info` text DEFAULT NULL COMMENT '流程信息',
|
||||
`bucket_index` int(11) NOT NULL DEFAULT '0' COMMENT 'bucket',
|
||||
`version` int(11) NOT NULL COMMENT '版本号',
|
||||
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
`deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT '逻辑删除 1、删除',
|
||||
`ext_attrs` varchar(256) NULL default '' COMMENT '扩展字段',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_create_dt` (`create_dt`),
|
||||
KEY `idx_namespace_id_group_name` (`namespace_id`, `group_name`)
|
||||
) ENGINE = InnoDB
|
||||
AUTO_INCREMENT = 0
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='工作流';
|
||||
|
||||
CREATE TABLE `er_workflow_node`
|
||||
(
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
|
||||
`node_name` varchar(64) NOT NULL COMMENT '节点名称',
|
||||
`group_name` varchar(64) NOT NULL COMMENT '组名称',
|
||||
`job_id` bigint(20) NOT NULL COMMENT '任务信息id',
|
||||
`workflow_id` bigint(20) NOT NULL COMMENT '工作流ID',
|
||||
`node_type` tinyint(4) NOT NULL DEFAULT 1 COMMENT '1、任务节点 2、条件节点',
|
||||
`expression_type` tinyint(4) NOT NULL DEFAULT 0 COMMENT '1、SpEl、2、Aviator 3、QL',
|
||||
`fail_strategy` tinyint(4) NOT NULL DEFAULT 1 COMMENT '失败策略 1、跳过 2、阻塞',
|
||||
`workflow_node_status` tinyint(4) NOT NULL DEFAULT 1 COMMENT '工作流节点状态 0、关闭、1、开启',
|
||||
`priority_level` int(11) NOT NULL DEFAULT 1 COMMENT '优先级',
|
||||
`node_info` text DEFAULT NULL COMMENT '节点信息 ',
|
||||
`version` int(11) NOT NULL COMMENT '版本号',
|
||||
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
`deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT '逻辑删除 1、删除',
|
||||
`ext_attrs` varchar(256) NULL default '' COMMENT '扩展字段',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_create_dt` (`create_dt`),
|
||||
KEY `idx_namespace_id_group_name` (`namespace_id`, `group_name`)
|
||||
) ENGINE = InnoDB
|
||||
AUTO_INCREMENT = 0
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='工作流节点';
|
||||
|
||||
CREATE TABLE `er_workflow_task_batch`
|
||||
(
|
||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`namespace_id` varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a' COMMENT '命名空间id',
|
||||
`group_name` varchar(64) NOT NULL COMMENT '组名称',
|
||||
`workflow_id` bigint(20) NOT NULL COMMENT '工作流任务id',
|
||||
`task_batch_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '任务批次状态 0、失败 1、成功',
|
||||
`operation_reason` tinyint(4) NOT NULL DEFAULT '0' COMMENT '操作原因',
|
||||
`flow_info` text DEFAULT NULL COMMENT '流程信息',
|
||||
`execution_at` bigint(13) NOT NULL DEFAULT '0' COMMENT '任务执行时间',
|
||||
`create_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_dt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
`deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT '逻辑删除 1、删除',
|
||||
`ext_attrs` varchar(256) NULL default '' COMMENT '扩展字段',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_job_id_task_batch_status` (`workflow_id`, `task_batch_status`),
|
||||
KEY `idx_create_dt` (`create_dt`),
|
||||
KEY `idx_namespace_id_group_name` (`namespace_id`, `group_name`)
|
||||
) ENGINE = InnoDB
|
||||
AUTO_INCREMENT = 0
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='工作流批次';
|
@ -65,3 +65,7 @@ ALTER TABLE `sys_social`
|
||||
|
||||
-- 数据库超级管理员的role_key由admin修改为SuperAdminRole
|
||||
UPDATE `sys_role` SET `role_key`='SuperAdminRole' WHERE `role_id`=1;
|
||||
|
||||
-- retry server控制台
|
||||
insert into sys_menu values('130', 'EasyRetry控制台', '2', '6', 'easyretry', 'monitor/easyretry/index', '', 1, 0, 'C', '0', '0', 'monitor:easyretry:list', 'job', 103, 1, sysdate(), null, null, 'EasyRetry控制台菜单');
|
||||
|
||||
|
805
script/sql/postgresql/easy_retry_postgre.sql
Normal file
805
script/sql/postgresql/easy_retry_postgre.sql
Normal file
@ -0,0 +1,805 @@
|
||||
-- PostgreSQL DDL
|
||||
|
||||
CREATE TABLE er_namespace
|
||||
(
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
name VARCHAR(64) NOT NULL,
|
||||
unique_id VARCHAR(64) NOT NULL,
|
||||
description VARCHAR(256) NOT NULL DEFAULT '',
|
||||
create_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
update_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
deleted SMALLINT NOT NULL DEFAULT 0
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX uk_namespace_unique_id ON er_namespace (unique_id);
|
||||
|
||||
COMMENT ON COLUMN er_namespace.id IS '主键';
|
||||
COMMENT ON COLUMN er_namespace.name IS '名称';
|
||||
COMMENT ON COLUMN er_namespace.unique_id IS '唯一id';
|
||||
COMMENT ON COLUMN er_namespace.description IS '描述';
|
||||
COMMENT ON COLUMN er_namespace.create_dt IS '创建时间';
|
||||
COMMENT ON COLUMN er_namespace.update_dt IS '修改时间';
|
||||
COMMENT ON COLUMN er_namespace.deleted IS '逻辑删除 1、删除';
|
||||
COMMENT ON TABLE er_namespace IS '命名空间';
|
||||
|
||||
INSERT INTO er_namespace VALUES (1, 'Development', 'dev', '', now(), now(), 0);
|
||||
INSERT INTO er_namespace VALUES (2, 'Production', 'prod', '', now(), now(), 0);
|
||||
|
||||
CREATE TABLE er_group_config
|
||||
(
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
namespace_id VARCHAR(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
|
||||
group_name VARCHAR(64) NOT NULL,
|
||||
description VARCHAR(256) DEFAULT '',
|
||||
token VARCHAR(64) DEFAULT 'ER_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT',
|
||||
group_status SMALLINT NOT NULL DEFAULT 0,
|
||||
version INT NOT NULL,
|
||||
group_partition INT NOT NULL,
|
||||
id_generator_mode SMALLINT NOT NULL DEFAULT 1,
|
||||
init_scene SMALLINT NOT NULL DEFAULT 0,
|
||||
bucket_index INT NOT NULL DEFAULT 0,
|
||||
create_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
update_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX uk_namespace_id_group_name_group_config ON er_group_config (namespace_id, group_name);
|
||||
|
||||
COMMENT ON COLUMN er_group_config.id IS '主键';
|
||||
COMMENT ON COLUMN er_group_config.namespace_id IS '命名空间';
|
||||
COMMENT ON COLUMN er_group_config.group_name IS '组名称';
|
||||
COMMENT ON COLUMN er_group_config.description IS '组描述';
|
||||
COMMENT ON COLUMN er_group_config.token IS 'token';
|
||||
COMMENT ON COLUMN er_group_config.group_status IS '组状态 0、未启用 1、启用';
|
||||
COMMENT ON COLUMN er_group_config.version IS '版本号';
|
||||
COMMENT ON COLUMN er_group_config.group_partition IS '分区';
|
||||
COMMENT ON COLUMN er_group_config.id_generator_mode IS '唯一id生成模式 默认号段模式';
|
||||
COMMENT ON COLUMN er_group_config.init_scene IS '是否初始化场景 0:否 1:是';
|
||||
COMMENT ON COLUMN er_group_config.bucket_index IS 'bucket';
|
||||
COMMENT ON COLUMN er_group_config.create_dt IS '创建时间';
|
||||
COMMENT ON COLUMN er_group_config.update_dt IS '修改时间';
|
||||
COMMENT ON TABLE er_group_config IS '组配置';
|
||||
|
||||
INSERT INTO er_group_config VALUES (1, 'dev', 'ruoyi_group', '', 'ER_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT', 1, 1, 0, 1, 1, 4, now(), now());
|
||||
|
||||
CREATE TABLE er_notify_config
|
||||
(
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
namespace_id VARCHAR(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
|
||||
group_name VARCHAR(64) NOT NULL,
|
||||
scene_name VARCHAR(64) NOT NULL,
|
||||
notify_status SMALLINT NOT NULL DEFAULT 0,
|
||||
notify_type SMALLINT NOT NULL DEFAULT 0,
|
||||
notify_attribute VARCHAR(512) NOT NULL,
|
||||
notify_threshold INT NOT NULL DEFAULT 0,
|
||||
notify_scene SMALLINT NOT NULL DEFAULT 0,
|
||||
rate_limiter_status SMALLINT NOT NULL DEFAULT 0,
|
||||
rate_limiter_threshold INT NOT NULL DEFAULT 0,
|
||||
description VARCHAR(256) NOT NULL DEFAULT '',
|
||||
create_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
update_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
CREATE INDEX idx_namespace_id_group_name_notify_config ON er_notify_config (namespace_id, group_name);
|
||||
|
||||
COMMENT ON COLUMN er_notify_config.id IS '主键';
|
||||
COMMENT ON COLUMN er_notify_config.group_name IS '组名称';
|
||||
COMMENT ON COLUMN er_notify_config.namespace_id IS '命名空间id';
|
||||
COMMENT ON COLUMN er_notify_config.scene_name IS '场景名称';
|
||||
COMMENT ON COLUMN er_notify_config.notify_status IS '通知状态 0、未启用 1、启用';
|
||||
COMMENT ON COLUMN er_notify_config.notify_type IS '通知类型 1、钉钉 2、邮件 3、企业微信';
|
||||
COMMENT ON COLUMN er_notify_config.notify_attribute IS '配置属性';
|
||||
COMMENT ON COLUMN er_notify_config.notify_threshold IS '通知阈值';
|
||||
COMMENT ON COLUMN er_notify_config.notify_scene IS '通知场景';
|
||||
COMMENT ON COLUMN er_notify_config.rate_limiter_status IS '限流状态 0、未启用 1、启用';
|
||||
COMMENT ON COLUMN er_notify_config.rate_limiter_threshold IS '每秒限流阈值';
|
||||
COMMENT ON COLUMN er_notify_config.description IS '描述';
|
||||
COMMENT ON COLUMN er_notify_config.create_dt IS '创建时间';
|
||||
COMMENT ON COLUMN er_notify_config.update_dt IS '修改时间';
|
||||
COMMENT ON TABLE er_notify_config IS '通知配置';
|
||||
|
||||
|
||||
CREATE TABLE er_retry_dead_letter_0
|
||||
(
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
unique_id VARCHAR(64) NOT NULL,
|
||||
namespace_id VARCHAR(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
|
||||
group_name VARCHAR(64) NOT NULL,
|
||||
scene_name VARCHAR(64) NOT NULL,
|
||||
idempotent_id VARCHAR(64) NOT NULL,
|
||||
biz_no VARCHAR(64) NOT NULL DEFAULT '',
|
||||
executor_name VARCHAR(512) NOT NULL DEFAULT '',
|
||||
args_str TEXT NOT NULL,
|
||||
ext_attrs TEXT NOT NULL,
|
||||
task_type SMALLINT NOT NULL DEFAULT 1,
|
||||
create_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX uk_namespace_id_group_name_unique_id_retry_dead_letter ON er_retry_dead_letter_0 (namespace_id, group_name, unique_id);
|
||||
CREATE INDEX idx_namespace_id_group_name_scene_name_retry_dead_letter ON er_retry_dead_letter_0 (namespace_id, group_name, scene_name);
|
||||
CREATE INDEX idx_idempotent_id_retry_dead_letter ON er_retry_dead_letter_0 (idempotent_id);
|
||||
CREATE INDEX idx_biz_no_retry_dead_letter ON er_retry_dead_letter_0 (biz_no);
|
||||
CREATE INDEX idx_create_dt_retry_dead_letter ON er_retry_dead_letter_0 (create_dt);
|
||||
|
||||
COMMENT ON COLUMN er_retry_dead_letter_0.id IS '主键';
|
||||
COMMENT ON COLUMN er_retry_dead_letter_0.unique_id IS '同组下id唯一';
|
||||
COMMENT ON COLUMN er_retry_dead_letter_0.namespace_id IS '命名空间id';
|
||||
COMMENT ON COLUMN er_retry_dead_letter_0.group_name IS '组名称';
|
||||
COMMENT ON COLUMN er_retry_dead_letter_0.scene_name IS '场景名称';
|
||||
COMMENT ON COLUMN er_retry_dead_letter_0.idempotent_id IS '幂等id';
|
||||
COMMENT ON COLUMN er_retry_dead_letter_0.biz_no IS '业务编号';
|
||||
COMMENT ON COLUMN er_retry_dead_letter_0.executor_name IS '执行器名称';
|
||||
COMMENT ON COLUMN er_retry_dead_letter_0.args_str IS '执行方法参数';
|
||||
COMMENT ON COLUMN er_retry_dead_letter_0.ext_attrs IS '扩展字段';
|
||||
COMMENT ON COLUMN er_retry_dead_letter_0.task_type IS '任务类型 1、重试数据 2、回调数据';
|
||||
COMMENT ON COLUMN er_retry_dead_letter_0.create_dt IS '创建时间';
|
||||
COMMENT ON TABLE er_retry_dead_letter_0 IS '死信队列表';
|
||||
|
||||
CREATE TABLE er_retry_task_0
|
||||
(
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
unique_id VARCHAR(64) NOT NULL,
|
||||
namespace_id VARCHAR(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
|
||||
group_name VARCHAR(64) NOT NULL,
|
||||
scene_name VARCHAR(64) NOT NULL,
|
||||
idempotent_id VARCHAR(64) NOT NULL,
|
||||
biz_no VARCHAR(64) NOT NULL DEFAULT '',
|
||||
executor_name VARCHAR(512) NOT NULL DEFAULT '',
|
||||
args_str TEXT NOT NULL,
|
||||
ext_attrs TEXT NOT NULL,
|
||||
next_trigger_at TIMESTAMP NOT NULL,
|
||||
retry_count INT NOT NULL DEFAULT 0,
|
||||
retry_status SMALLINT NOT NULL DEFAULT 0,
|
||||
task_type SMALLINT NOT NULL DEFAULT 1,
|
||||
create_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
update_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX uk_name_unique_id_retry_task ON er_retry_task_0 (namespace_id, group_name, unique_id);
|
||||
CREATE INDEX idx_namespace_id_group_name_scene_name_retry_task ON er_retry_task_0 (namespace_id, group_name, scene_name);
|
||||
CREATE INDEX idx_namespace_id_group_name_retry_status_retry_task ON er_retry_task_0 (namespace_id, group_name, retry_status);
|
||||
CREATE INDEX idx_idempotent_id_retry_task ON er_retry_task_0 (idempotent_id);
|
||||
CREATE INDEX idx_biz_no_retry_task ON er_retry_task_0 (biz_no);
|
||||
CREATE INDEX idx_create_dt_retry_task ON er_retry_task_0 (create_dt);
|
||||
|
||||
COMMENT ON COLUMN er_retry_task_0.id IS '主键';
|
||||
COMMENT ON COLUMN er_retry_task_0.unique_id IS '同组下id唯一';
|
||||
COMMENT ON COLUMN er_retry_task_0.namespace_id IS '命名空间id';
|
||||
COMMENT ON COLUMN er_retry_task_0.group_name IS '组名称';
|
||||
COMMENT ON COLUMN er_retry_task_0.scene_name IS '场景名称';
|
||||
COMMENT ON COLUMN er_retry_task_0.idempotent_id IS '幂等id';
|
||||
COMMENT ON COLUMN er_retry_task_0.biz_no IS '业务编号';
|
||||
COMMENT ON COLUMN er_retry_task_0.executor_name IS '执行器名称';
|
||||
COMMENT ON COLUMN er_retry_task_0.args_str IS '执行方法参数';
|
||||
COMMENT ON COLUMN er_retry_task_0.ext_attrs IS '扩展字段';
|
||||
COMMENT ON COLUMN er_retry_task_0.next_trigger_at IS '下次触发时间';
|
||||
COMMENT ON COLUMN er_retry_task_0.retry_count IS '重试次数';
|
||||
COMMENT ON COLUMN er_retry_task_0.retry_status IS '重试状态 0、重试中 1、成功 2、最大重试次数';
|
||||
COMMENT ON COLUMN er_retry_task_0.task_type IS '任务类型 1、重试数据 2、回调数据';
|
||||
COMMENT ON COLUMN er_retry_task_0.create_dt IS '创建时间';
|
||||
COMMENT ON COLUMN er_retry_task_0.update_dt IS '修改时间';
|
||||
COMMENT ON TABLE er_retry_task_0 IS '任务表';
|
||||
|
||||
CREATE TABLE er_retry_task_log
|
||||
(
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
unique_id VARCHAR(64) NOT NULL,
|
||||
namespace_id VARCHAR(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
|
||||
group_name VARCHAR(64) NOT NULL,
|
||||
scene_name VARCHAR(64) NOT NULL,
|
||||
idempotent_id VARCHAR(64) NOT NULL,
|
||||
biz_no VARCHAR(64) NOT NULL DEFAULT '',
|
||||
executor_name VARCHAR(512) NOT NULL DEFAULT '',
|
||||
args_str TEXT NOT NULL,
|
||||
ext_attrs TEXT NOT NULL,
|
||||
retry_status SMALLINT NOT NULL DEFAULT 0,
|
||||
task_type SMALLINT NOT NULL DEFAULT 1,
|
||||
create_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
update_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
|
||||
);
|
||||
|
||||
CREATE INDEX idx_group_name_scene_name_retry_task_log ON er_retry_task_log (namespace_id, group_name, scene_name);
|
||||
CREATE INDEX idx_retry_status_retry_task_log ON er_retry_task_log (retry_status);
|
||||
CREATE INDEX idx_idempotent_id_retry_task_log ON er_retry_task_log (idempotent_id);
|
||||
CREATE INDEX idx_unique_id ON er_retry_task_log (namespace_id, group_name, unique_id);
|
||||
CREATE INDEX idx_biz_no_retry_task_log ON er_retry_task_log (biz_no);
|
||||
CREATE INDEX idx_create_dt_retry_task_log ON er_retry_task_log (create_dt);
|
||||
|
||||
COMMENT ON COLUMN er_retry_task_log.id IS '主键';
|
||||
COMMENT ON COLUMN er_retry_task_log.namespace_id IS '命名空间id';
|
||||
COMMENT ON COLUMN er_retry_task_log.unique_id IS '同组下id唯一';
|
||||
COMMENT ON COLUMN er_retry_task_log.group_name IS '组名称';
|
||||
COMMENT ON COLUMN er_retry_task_log.scene_name IS '场景名称';
|
||||
COMMENT ON COLUMN er_retry_task_log.idempotent_id IS '幂等id';
|
||||
COMMENT ON COLUMN er_retry_task_log.biz_no IS '业务编号';
|
||||
COMMENT ON COLUMN er_retry_task_log.executor_name IS '执行器名称';
|
||||
COMMENT ON COLUMN er_retry_task_log.args_str IS '执行方法参数';
|
||||
COMMENT ON COLUMN er_retry_task_log.ext_attrs IS '扩展字段';
|
||||
COMMENT ON COLUMN er_retry_task_log.retry_status IS '重试状态 0、重试中 1、成功 2、最大次数';
|
||||
COMMENT ON COLUMN er_retry_task_log.task_type IS '任务类型 1、重试数据 2、回调数据';
|
||||
COMMENT ON COLUMN er_retry_task_log.create_dt IS '创建时间';
|
||||
COMMENT ON COLUMN er_retry_task_log.update_dt IS '修改时间';
|
||||
COMMENT ON TABLE er_retry_task_log IS '任务日志基础信息表';
|
||||
|
||||
CREATE TABLE er_retry_task_log_message
|
||||
(
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
namespace_id VARCHAR(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
|
||||
group_name VARCHAR(64) NOT NULL,
|
||||
unique_id VARCHAR(64) NOT NULL,
|
||||
create_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
message TEXT NOT NULL,
|
||||
log_num INT NOT NULL DEFAULT 1,
|
||||
real_time BIGINT NOT NULL DEFAULT 0
|
||||
);
|
||||
|
||||
CREATE INDEX idx_namespace_id_group_name_unique_id ON er_retry_task_log_message (namespace_id, group_name, unique_id);
|
||||
CREATE INDEX idx_create_dt ON er_retry_task_log_message (create_dt);
|
||||
COMMENT ON COLUMN er_retry_task_log_message.id IS '主键';
|
||||
COMMENT ON COLUMN er_retry_task_log_message.namespace_id IS '命名空间';
|
||||
COMMENT ON COLUMN er_retry_task_log_message.group_name IS '组名称';
|
||||
COMMENT ON COLUMN er_retry_task_log_message.unique_id IS '同组下id唯一';
|
||||
COMMENT ON COLUMN er_retry_task_log_message.create_dt IS '创建时间';
|
||||
COMMENT ON COLUMN er_retry_task_log_message.message IS '异常信息';
|
||||
COMMENT ON COLUMN er_retry_task_log_message.log_num IS '日志条数';
|
||||
COMMENT ON COLUMN er_retry_task_log_message.real_time IS '实际时间';
|
||||
COMMENT ON TABLE er_retry_task_log_message IS '任务调度日志信息记录表';
|
||||
|
||||
CREATE TABLE er_scene_config
|
||||
(
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
namespace_id VARCHAR(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
|
||||
scene_name VARCHAR(64) NOT NULL,
|
||||
group_name VARCHAR(64) NOT NULL,
|
||||
scene_status SMALLINT NOT NULL DEFAULT 0,
|
||||
max_retry_count INT NOT NULL DEFAULT 5,
|
||||
back_off SMALLINT NOT NULL DEFAULT 1,
|
||||
trigger_interval VARCHAR(16) NOT NULL DEFAULT '',
|
||||
deadline_request BIGINT NOT NULL DEFAULT 60000,
|
||||
route_key SMALLINT NOT NULL DEFAULT 4,
|
||||
executor_timeout INT NOT NULL DEFAULT 5,
|
||||
description VARCHAR(256) NOT NULL DEFAULT '',
|
||||
create_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
update_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX uk_namespace_id_group_name_scene_name ON er_scene_config (namespace_id, group_name, scene_name);
|
||||
COMMENT ON COLUMN er_scene_config.id IS '主键';
|
||||
COMMENT ON COLUMN er_scene_config.namespace_id IS '命名空间id';
|
||||
COMMENT ON COLUMN er_scene_config.scene_name IS '场景名称';
|
||||
COMMENT ON COLUMN er_scene_config.group_name IS '组名称';
|
||||
COMMENT ON COLUMN er_scene_config.scene_status IS '组状态 0、未启用 1、启用';
|
||||
COMMENT ON COLUMN er_scene_config.max_retry_count IS '最大重试次数';
|
||||
COMMENT ON COLUMN er_scene_config.back_off IS '1、默认等级 2、固定间隔时间 3、CRON 表达式';
|
||||
COMMENT ON COLUMN er_scene_config.trigger_interval IS '间隔时长';
|
||||
COMMENT ON COLUMN er_scene_config.deadline_request IS 'Deadline Request 调用链超时 单位毫秒';
|
||||
COMMENT ON COLUMN er_scene_config.description IS '描述';
|
||||
COMMENT ON COLUMN er_scene_config.route_key IS '路由策略';
|
||||
COMMENT ON COLUMN er_scene_config.executor_timeout IS '超时时间';
|
||||
COMMENT ON COLUMN er_scene_config.create_dt IS '创建时间';
|
||||
COMMENT ON COLUMN er_scene_config.update_dt IS '修改时间';
|
||||
COMMENT ON TABLE er_scene_config IS '场景配置';
|
||||
|
||||
CREATE TABLE er_server_node
|
||||
(
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
namespace_id VARCHAR(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
|
||||
group_name VARCHAR(64) NOT NULL,
|
||||
host_id VARCHAR(64) NOT NULL,
|
||||
host_ip VARCHAR(64) NOT NULL,
|
||||
context_path VARCHAR(256) NOT NULL DEFAULT '/',
|
||||
host_port INT NOT NULL,
|
||||
expire_at TIMESTAMP NOT NULL,
|
||||
node_type SMALLINT NOT NULL,
|
||||
ext_attrs VARCHAR(256) DEFAULT '',
|
||||
create_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
update_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX uk_host_id_host_ip ON er_server_node (host_id, host_ip);
|
||||
CREATE INDEX idx_expire_at_node_type ON er_server_node (expire_at, node_type);
|
||||
CREATE INDEX idx_namespace_id_group_name_server_node ON er_server_node (namespace_id, group_name);
|
||||
|
||||
COMMENT ON COLUMN er_server_node.id IS '主键';
|
||||
COMMENT ON COLUMN er_server_node.group_name IS '组名称';
|
||||
COMMENT ON COLUMN er_server_node.namespace_id IS '命名空间id';
|
||||
COMMENT ON COLUMN er_server_node.host_id IS '主机id';
|
||||
COMMENT ON COLUMN er_server_node.host_ip IS '机器ip';
|
||||
COMMENT ON COLUMN er_server_node.context_path IS '客户端上下文路径 server.servlet.context-path';
|
||||
COMMENT ON COLUMN er_server_node.host_port IS '机器端口';
|
||||
COMMENT ON COLUMN er_server_node.expire_at IS '过期时间';
|
||||
COMMENT ON COLUMN er_server_node.node_type IS '节点类型 1、客户端 2、是服务端';
|
||||
COMMENT ON COLUMN er_server_node.ext_attrs IS '扩展字段';
|
||||
COMMENT ON COLUMN er_server_node.create_dt IS '创建时间';
|
||||
COMMENT ON COLUMN er_server_node.update_dt IS '修改时间';
|
||||
COMMENT ON TABLE er_server_node IS '服务器节点';
|
||||
|
||||
CREATE TABLE er_distributed_lock
|
||||
(
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
name VARCHAR(64) NOT NULL,
|
||||
lock_until TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
locked_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
locked_by VARCHAR(255) NOT NULL,
|
||||
create_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
update_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
ALTER TABLE er_distributed_lock
|
||||
ADD CONSTRAINT uk_name UNIQUE (name);
|
||||
|
||||
COMMENT ON COLUMN er_distributed_lock.id IS '主键';
|
||||
COMMENT ON COLUMN er_distributed_lock.name IS '锁名称';
|
||||
COMMENT ON COLUMN er_distributed_lock.lock_until IS '锁定时长';
|
||||
COMMENT ON COLUMN er_distributed_lock.locked_at IS '锁定时间';
|
||||
COMMENT ON COLUMN er_distributed_lock.locked_by IS '锁定者';
|
||||
COMMENT ON COLUMN er_distributed_lock.create_dt IS '创建时间';
|
||||
COMMENT ON COLUMN er_distributed_lock.update_dt IS '修改时间';
|
||||
COMMENT ON TABLE er_distributed_lock IS '锁定表';
|
||||
|
||||
|
||||
CREATE TABLE er_system_user
|
||||
(
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
username VARCHAR(64) NOT NULL,
|
||||
password VARCHAR(128) NOT NULL,
|
||||
role SMALLINT NOT NULL DEFAULT 0,
|
||||
create_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
update_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX uk_username ON er_system_user (username);
|
||||
COMMENT ON COLUMN er_system_user.id IS '主键';
|
||||
COMMENT ON COLUMN er_system_user.username IS '账号';
|
||||
COMMENT ON COLUMN er_system_user.password IS '密码';
|
||||
COMMENT ON COLUMN er_system_user.role IS '角色:1-普通用户、2-管理员';
|
||||
COMMENT ON COLUMN er_system_user.create_dt IS '创建时间';
|
||||
COMMENT ON COLUMN er_system_user.update_dt IS '修改时间';
|
||||
COMMENT ON TABLE er_system_user IS '系统用户表';
|
||||
|
||||
-- pwd: admin
|
||||
INSERT INTO er_system_user VALUES (1, 'admin', '465c194afb65670f38322df087f0a9bb225cc257e43eb4ac5a0c98ef5b3173ac', 2, now(), now());
|
||||
|
||||
CREATE TABLE er_system_user_permission
|
||||
(
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
namespace_id VARCHAR(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
|
||||
group_name VARCHAR(64) NOT NULL,
|
||||
system_user_id BIGINT NOT NULL,
|
||||
create_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
update_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX uk_namespace_id_group_name_system_user_id ON er_system_user_permission (namespace_id, group_name, system_user_id);
|
||||
COMMENT ON COLUMN er_system_user_permission.id IS '主键';
|
||||
COMMENT ON COLUMN er_system_user_permission.namespace_id IS '命名空间id';
|
||||
COMMENT ON COLUMN er_system_user_permission.group_name IS '组名称';
|
||||
COMMENT ON COLUMN er_system_user_permission.system_user_id IS '系统用户id';
|
||||
COMMENT ON COLUMN er_system_user_permission.create_dt IS '创建时间';
|
||||
COMMENT ON COLUMN er_system_user_permission.update_dt IS '修改时间';
|
||||
COMMENT ON TABLE er_system_user_permission IS '系统用户权限表';
|
||||
|
||||
|
||||
CREATE TABLE er_sequence_alloc
|
||||
(
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
namespace_id VARCHAR(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
|
||||
group_name VARCHAR(64) NOT NULL DEFAULT '',
|
||||
max_id BIGINT NOT NULL DEFAULT 1,
|
||||
step INT NOT NULL DEFAULT 100,
|
||||
update_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX uk_namespace_id_group_name ON er_sequence_alloc (namespace_id, group_name);
|
||||
|
||||
COMMENT ON COLUMN er_sequence_alloc.id IS '主键';
|
||||
COMMENT ON COLUMN er_sequence_alloc.namespace_id IS '命名空间id';
|
||||
COMMENT ON COLUMN er_sequence_alloc.group_name IS '组名称';
|
||||
COMMENT ON COLUMN er_sequence_alloc.max_id IS '最大id';
|
||||
COMMENT ON COLUMN er_sequence_alloc.step IS '步长';
|
||||
COMMENT ON COLUMN er_sequence_alloc.update_dt IS '更新时间';
|
||||
COMMENT ON TABLE er_sequence_alloc IS '号段模式序号ID分配表';
|
||||
|
||||
-- 分布式调度DDL
|
||||
CREATE TABLE er_job
|
||||
(
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
namespace_id VARCHAR(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
|
||||
group_name VARCHAR(64) NOT NULL,
|
||||
job_name VARCHAR(64) NOT NULL,
|
||||
args_str TEXT NOT NULL DEFAULT '',
|
||||
args_type SMALLINT NOT NULL DEFAULT 1,
|
||||
next_trigger_at BIGINT NOT NULL,
|
||||
job_status SMALLINT NOT NULL DEFAULT 1,
|
||||
task_type SMALLINT NOT NULL DEFAULT 1,
|
||||
route_key SMALLINT NOT NULL DEFAULT 4,
|
||||
executor_type SMALLINT NOT NULL DEFAULT 1,
|
||||
executor_info VARCHAR(255) DEFAULT NULL,
|
||||
trigger_type SMALLINT NOT NULL,
|
||||
trigger_interval VARCHAR(255) NOT NULL,
|
||||
block_strategy SMALLINT NOT NULL DEFAULT 1,
|
||||
executor_timeout INT NOT NULL DEFAULT 0,
|
||||
max_retry_times INT NOT NULL DEFAULT 0,
|
||||
parallel_num INT NOT NULL DEFAULT 1,
|
||||
retry_interval INT NOT NULL DEFAULT 0,
|
||||
bucket_index INT NOT NULL DEFAULT 0,
|
||||
resident SMALLINT NOT NULL DEFAULT 0,
|
||||
description VARCHAR(256) NOT NULL DEFAULT '',
|
||||
ext_attrs VARCHAR(256) DEFAULT NULL,
|
||||
create_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
update_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
deleted SMALLINT NOT NULL DEFAULT 0
|
||||
);
|
||||
|
||||
CREATE INDEX idx_namespace_id_group_name_job ON er_job (namespace_id, group_name);
|
||||
CREATE INDEX idx_job_status_bucket_index_job ON er_job (job_status, bucket_index);
|
||||
CREATE INDEX idx_create_dt_job ON er_job (create_dt);
|
||||
|
||||
COMMENT ON COLUMN er_job.id IS '主键';
|
||||
COMMENT ON COLUMN er_job.namespace_id IS '命名空间id';
|
||||
COMMENT ON COLUMN er_job.group_name IS '组名称';
|
||||
COMMENT ON COLUMN er_job.job_name IS '名称';
|
||||
COMMENT ON COLUMN er_job.args_str IS '执行方法参数';
|
||||
COMMENT ON COLUMN er_job.args_type IS '参数类型';
|
||||
COMMENT ON COLUMN er_job.next_trigger_at IS '下次触发时间';
|
||||
COMMENT ON COLUMN er_job.job_status IS '重试状态 0、关闭、1、开启';
|
||||
COMMENT ON COLUMN er_job.task_type IS '任务类型 1、集群 2、广播 3、切片';
|
||||
COMMENT ON COLUMN er_job.route_key IS '路由策略';
|
||||
COMMENT ON COLUMN er_job.executor_type IS '执行器类型';
|
||||
COMMENT ON COLUMN er_job.executor_info IS '执行器名称';
|
||||
COMMENT ON COLUMN er_job.trigger_type IS '触发类型 1.CRON 表达式 2. 固定时间';
|
||||
COMMENT ON COLUMN er_job.trigger_interval IS '间隔时长';
|
||||
COMMENT ON COLUMN er_job.block_strategy IS '阻塞策略 1、丢弃 2、覆盖 3、并行';
|
||||
COMMENT ON COLUMN er_job.executor_timeout IS '任务执行超时时间,单位秒';
|
||||
COMMENT ON COLUMN er_job.max_retry_times IS '最大重试次数';
|
||||
COMMENT ON COLUMN er_job.parallel_num IS '并行数';
|
||||
COMMENT ON COLUMN er_job.retry_interval IS '更新重试间隔(s)';
|
||||
COMMENT ON COLUMN er_job.bucket_index IS 'bucket';
|
||||
COMMENT ON COLUMN er_job.resident IS '是否是常驻任务';
|
||||
COMMENT ON COLUMN er_job.description IS '描述';
|
||||
COMMENT ON COLUMN er_job.ext_attrs IS '扩展字段';
|
||||
COMMENT ON COLUMN er_job.create_dt IS '创建时间';
|
||||
COMMENT ON COLUMN er_job.deleted IS '逻辑删除 1、删除';
|
||||
COMMENT ON COLUMN er_job.update_dt IS '更新时间';
|
||||
COMMENT ON TABLE er_job IS '任务信息';
|
||||
|
||||
CREATE TABLE er_job_log_message
|
||||
(
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
namespace_id VARCHAR(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
|
||||
group_name VARCHAR(64) NOT NULL,
|
||||
job_id BIGINT NOT NULL,
|
||||
task_batch_id BIGINT NOT NULL,
|
||||
task_id BIGINT NOT NULL,
|
||||
message TEXT NOT NULL,
|
||||
log_num INT NOT NULL DEFAULT 1,
|
||||
real_time BIGINT NOT NULL DEFAULT 0,
|
||||
ext_attrs VARCHAR(256) DEFAULT '',
|
||||
create_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
CREATE INDEX idx_namespace_id_group_name_to_job_log_message ON er_job_log_message (namespace_id, group_name);
|
||||
CREATE INDEX idx_task_batch_id_task_id_to_job_log_message ON er_job_log_message (task_batch_id, task_id);
|
||||
CREATE INDEX idx_create_dt_to_job_log_message ON er_job_log_message (create_dt);
|
||||
|
||||
COMMENT ON COLUMN er_job_log_message.id IS '主键';
|
||||
COMMENT ON COLUMN er_job_log_message.namespace_id IS '命名空间id';
|
||||
COMMENT ON COLUMN er_job_log_message.group_name IS '组名称';
|
||||
COMMENT ON COLUMN er_job_log_message.job_id IS '任务信息id';
|
||||
COMMENT ON COLUMN er_job_log_message.task_batch_id IS '任务批次id';
|
||||
COMMENT ON COLUMN er_job_log_message.task_id IS '调度任务id';
|
||||
COMMENT ON COLUMN er_job_log_message.message IS '调度信息';
|
||||
COMMENT ON COLUMN er_job_log_message.log_num IS '日志序号';
|
||||
COMMENT ON COLUMN er_job_log_message.real_time IS '实际时间';
|
||||
COMMENT ON COLUMN er_job_log_message.create_dt IS '创建时间';
|
||||
COMMENT ON COLUMN er_job_log_message.ext_attrs IS '扩展字段';
|
||||
COMMENT ON TABLE er_job_log_message IS '调度日志';
|
||||
|
||||
CREATE TABLE er_job_task
|
||||
(
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
namespace_id VARCHAR(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
|
||||
group_name VARCHAR(64) NOT NULL,
|
||||
job_id BIGINT NOT NULL,
|
||||
task_batch_id BIGINT NOT NULL,
|
||||
parent_id BIGINT NOT NULL DEFAULT 0,
|
||||
task_status SMALLINT NOT NULL DEFAULT 0,
|
||||
retry_count INT NOT NULL DEFAULT 0,
|
||||
client_info VARCHAR(128) DEFAULT NULL,
|
||||
result_message TEXT NOT NULL,
|
||||
args_str TEXT NOT NULL,
|
||||
args_type SMALLINT NOT NULL DEFAULT 1,
|
||||
ext_attrs VARCHAR(256) DEFAULT '',
|
||||
create_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
update_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
|
||||
CREATE INDEX idx_namespace_id_group_name_to_job_task ON er_job_task (namespace_id, group_name);
|
||||
CREATE INDEX idx_task_batch_id_task_status_to_job_task ON er_job_task (task_batch_id, task_status);
|
||||
CREATE INDEX idx_create_dt_to_job_task ON er_job_task (create_dt);
|
||||
COMMENT ON COLUMN er_job_task.id IS '主键';
|
||||
COMMENT ON COLUMN er_job_task.namespace_id IS '命名空间id';
|
||||
COMMENT ON COLUMN er_job_task.group_name IS '组名称';
|
||||
COMMENT ON COLUMN er_job_task.job_id IS '任务信息id';
|
||||
COMMENT ON COLUMN er_job_task.task_batch_id IS '任务批次id';
|
||||
COMMENT ON COLUMN er_job_task.parent_id IS '父执行器id';
|
||||
COMMENT ON COLUMN er_job_task.task_status IS '执行的状态 0、失败 1、成功';
|
||||
COMMENT ON COLUMN er_job_task.retry_count IS '重试次数';
|
||||
COMMENT ON COLUMN er_job_task.client_info IS '客户端地址 clientId#ip:port';
|
||||
COMMENT ON COLUMN er_job_task.result_message IS '调度信息';
|
||||
COMMENT ON COLUMN er_job_task.args_str IS '执行方法参数';
|
||||
COMMENT ON COLUMN er_job_task.args_type IS '参数类型';
|
||||
COMMENT ON COLUMN er_job_task.create_dt IS '创建时间';
|
||||
COMMENT ON COLUMN er_job_task.update_dt IS '创建时间';
|
||||
COMMENT ON COLUMN er_job_task.ext_attrs IS '扩展字段';
|
||||
COMMENT ON TABLE er_job_task IS '任务实例';
|
||||
|
||||
CREATE TABLE er_job_task_batch
|
||||
(
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
namespace_id VARCHAR(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
|
||||
group_name VARCHAR(64) NOT NULL,
|
||||
job_id BIGINT NOT NULL,
|
||||
workflow_node_id BIGINT NOT NULL DEFAULT 0,
|
||||
parent_workflow_node_id BIGINT NOT NULL DEFAULT 0,
|
||||
workflow_task_batch_id BIGINT NOT NULL DEFAULT 0,
|
||||
parent_id VARCHAR(64) NOT NULL DEFAULT '',
|
||||
task_batch_status SMALLINT NOT NULL DEFAULT 0,
|
||||
operation_reason SMALLINT NOT NULL DEFAULT 0,
|
||||
execution_at BIGINT NOT NULL DEFAULT 0,
|
||||
system_task_type SMALLINT NOT NULL DEFAULT 3,
|
||||
ext_attrs VARCHAR(256) DEFAULT '',
|
||||
deleted SMALLINT NOT NULL DEFAULT 0,
|
||||
create_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
update_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
CREATE INDEX idx_namespace_id_group_name_to_job_task_batch ON er_job_task_batch (namespace_id, group_name);
|
||||
CREATE INDEX idx_job_id_task_batch_status_to_job_task_batch ON er_job_task_batch (job_id, task_batch_status);
|
||||
CREATE INDEX idx_create_dt_to_job_task_batch ON er_job_task_batch (create_dt);
|
||||
CREATE INDEX idx_workflow_task_batch_id_workflow_node_id ON er_job_task_batch (workflow_task_batch_id, workflow_node_id);
|
||||
|
||||
COMMENT ON COLUMN er_job_task_batch.id IS '主键';
|
||||
COMMENT ON COLUMN er_job_task_batch.namespace_id IS '命名空间id';
|
||||
COMMENT ON COLUMN er_job_task_batch.group_name IS '组名称';
|
||||
COMMENT ON COLUMN er_job_task_batch.job_id IS '任务信息id';
|
||||
COMMENT ON COLUMN er_job_task_batch.task_batch_status IS '任务批次状态 0、失败 1、成功';
|
||||
COMMENT ON COLUMN er_job_task_batch.operation_reason IS '操作原因';
|
||||
COMMENT ON COLUMN er_job_task_batch.workflow_node_id IS '工作流节点id';
|
||||
COMMENT ON COLUMN er_job_task_batch.parent_workflow_node_id IS '父节点';
|
||||
COMMENT ON COLUMN er_job_task_batch.workflow_task_batch_id IS '任务批次id';
|
||||
COMMENT ON COLUMN er_job_task_batch.system_task_type IS '任务类型 0、系统任务 1、业务任务';
|
||||
COMMENT ON COLUMN er_job_task_batch.execution_at IS '任务执行时间';
|
||||
COMMENT ON COLUMN er_job_task_batch.parent_id IS '父节点';
|
||||
COMMENT ON COLUMN er_job_task_batch.deleted IS '逻辑删除 1、删除';
|
||||
COMMENT ON COLUMN er_job_task_batch.create_dt IS '创建时间';
|
||||
COMMENT ON COLUMN er_job_task_batch.update_dt IS '创建时间';
|
||||
COMMENT ON COLUMN er_job_task_batch.ext_attrs IS '扩展字段';
|
||||
COMMENT ON TABLE er_job_task_batch IS '任务批次';
|
||||
|
||||
CREATE TABLE er_job_notify_config
|
||||
(
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
namespace_id VARCHAR(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
|
||||
group_name VARCHAR(64) NOT NULL,
|
||||
job_id BIGINT NOT NULL,
|
||||
notify_status SMALLINT NOT NULL DEFAULT 0,
|
||||
notify_type SMALLINT NOT NULL DEFAULT 0,
|
||||
notify_attribute VARCHAR(512) NOT NULL,
|
||||
notify_threshold INT NOT NULL DEFAULT 0,
|
||||
notify_scene SMALLINT NOT NULL DEFAULT 0,
|
||||
rate_limiter_status SMALLINT NOT NULL DEFAULT 0,
|
||||
rate_limiter_threshold INT NOT NULL DEFAULT 0,
|
||||
description VARCHAR(256) NOT NULL DEFAULT '',
|
||||
create_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
update_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
CREATE INDEX idx_namespace_id_group_name_job_id_job_notify_config ON er_job_notify_config (namespace_id, group_name, job_id);
|
||||
|
||||
COMMENT ON COLUMN er_job_notify_config.id IS '主键';
|
||||
COMMENT ON COLUMN er_job_notify_config.namespace_id IS '命名空间id';
|
||||
COMMENT ON COLUMN er_job_notify_config.group_name IS '组名称';
|
||||
COMMENT ON COLUMN er_job_notify_config.job_id IS '任务信息id';
|
||||
COMMENT ON COLUMN er_job_notify_config.notify_status IS '通知状态 0、未启用 1、启用';
|
||||
COMMENT ON COLUMN er_job_notify_config.notify_type IS '通知类型 1、钉钉 2、邮件 3、企业微信';
|
||||
COMMENT ON COLUMN er_job_notify_config.notify_attribute IS '配置属性';
|
||||
COMMENT ON COLUMN er_job_notify_config.notify_threshold IS '通知阈值';
|
||||
COMMENT ON COLUMN er_job_notify_config.notify_scene IS '通知场景';
|
||||
COMMENT ON COLUMN er_job_notify_config.rate_limiter_status IS '限流状态 0、未启用 1、启用';
|
||||
COMMENT ON COLUMN er_job_notify_config.rate_limiter_threshold IS '每秒限流阈值';
|
||||
COMMENT ON COLUMN er_job_notify_config.description IS '描述';
|
||||
COMMENT ON COLUMN er_job_notify_config.create_dt IS '创建时间';
|
||||
COMMENT ON COLUMN er_job_notify_config.update_dt IS '修改时间';
|
||||
COMMENT ON TABLE er_job_notify_config IS '通知配置';
|
||||
|
||||
CREATE TABLE er_retry_summary
|
||||
(
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
namespace_id VARCHAR(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
|
||||
group_name VARCHAR(64) NOT NULL DEFAULT '',
|
||||
scene_name VARCHAR(50) NOT NULL DEFAULT '',
|
||||
trigger_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
running_num INT NOT NULL DEFAULT 0,
|
||||
finish_num INT NOT NULL DEFAULT 0,
|
||||
max_count_num INT NOT NULL DEFAULT 0,
|
||||
suspend_num INT NOT NULL DEFAULT 0,
|
||||
create_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
update_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX uk_scene_name_trigger_at ON er_retry_summary (namespace_id, group_name, scene_name, trigger_at);
|
||||
|
||||
COMMENT ON COLUMN er_retry_summary.id IS '主键';
|
||||
COMMENT ON COLUMN er_retry_summary.namespace_id IS '命名空间id';
|
||||
COMMENT ON COLUMN er_retry_summary.group_name IS '组名称';
|
||||
COMMENT ON COLUMN er_retry_summary.scene_name IS '场景名称';
|
||||
COMMENT ON COLUMN er_retry_summary.trigger_at IS '统计时间';
|
||||
COMMENT ON COLUMN er_retry_summary.running_num IS '重试中-日志数量';
|
||||
COMMENT ON COLUMN er_retry_summary.finish_num IS '重试完成-日志数量';
|
||||
COMMENT ON COLUMN er_retry_summary.max_count_num IS '重试到达最大次数-日志数量';
|
||||
COMMENT ON COLUMN er_retry_summary.suspend_num IS '暂停重试-日志数量';
|
||||
COMMENT ON COLUMN er_retry_summary.create_dt IS '创建时间';
|
||||
COMMENT ON COLUMN er_retry_summary.update_dt IS '修改时间';
|
||||
COMMENT ON TABLE er_retry_summary IS 'DashBoard_Retry';
|
||||
|
||||
CREATE TABLE er_job_summary
|
||||
(
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
namespace_id VARCHAR(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
|
||||
group_name VARCHAR(64) NOT NULL DEFAULT '',
|
||||
business_id BIGINT NOT NULL,
|
||||
system_task_type SMALLINT NOT NULL DEFAULT '3',
|
||||
trigger_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
success_num INT NOT NULL DEFAULT 0,
|
||||
fail_num INT NOT NULL DEFAULT 0,
|
||||
fail_reason VARCHAR(512) NOT NULL DEFAULT '',
|
||||
stop_num INT NOT NULL DEFAULT 0,
|
||||
stop_reason VARCHAR(512) NOT NULL DEFAULT '',
|
||||
cancel_num INT NOT NULL DEFAULT 0,
|
||||
cancel_reason VARCHAR(512) NOT NULL DEFAULT '',
|
||||
create_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
update_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX uk_trigger_at_system_task_type_business_id ON er_job_summary (trigger_at, system_task_type, business_id);
|
||||
CREATE INDEX idx_namespace_id_group_name_job_id ON er_job_summary (namespace_id, group_name, business_id);
|
||||
|
||||
COMMENT ON COLUMN er_job_summary.id IS '主键';
|
||||
COMMENT ON COLUMN er_job_summary.namespace_id IS '命名空间id';
|
||||
COMMENT ON COLUMN er_job_summary.group_name IS '组名称';
|
||||
COMMENT ON COLUMN er_job_summary.business_id IS '业务id (job_id或workflow_id)';
|
||||
COMMENT ON COLUMN er_job_summary.system_task_type IS '任务类型 3、JOB任务 4、WORKFLOW任务';
|
||||
COMMENT ON COLUMN er_job_summary.trigger_at IS '统计时间';
|
||||
COMMENT ON COLUMN er_job_summary.success_num IS '执行成功-日志数量';
|
||||
COMMENT ON COLUMN er_job_summary.fail_num IS '执行失败-日志数量';
|
||||
COMMENT ON COLUMN er_job_summary.fail_reason IS '失败原因';
|
||||
COMMENT ON COLUMN er_job_summary.stop_num IS '执行失败-日志数量';
|
||||
COMMENT ON COLUMN er_job_summary.stop_reason IS '失败原因';
|
||||
COMMENT ON COLUMN er_job_summary.cancel_num IS '执行失败-日志数量';
|
||||
COMMENT ON COLUMN er_job_summary.cancel_reason IS '失败原因';
|
||||
COMMENT ON TABLE er_job_summary IS 'DashBoard_Job';
|
||||
|
||||
CREATE TABLE er_workflow
|
||||
(
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
workflow_name varchar(64) NOT NULL,
|
||||
namespace_id varchar(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
|
||||
group_name varchar(64) NOT NULL,
|
||||
workflow_status smallint NOT NULL DEFAULT 1,
|
||||
trigger_type smallint NOT NULL,
|
||||
trigger_interval varchar(255) NOT NULL,
|
||||
next_trigger_at BIGINT NOT NULL,
|
||||
block_strategy smallint NOT NULL DEFAULT 1,
|
||||
executor_timeout INT NOT NULL DEFAULT 0,
|
||||
description varchar(256) NOT NULL DEFAULT '',
|
||||
flow_info text DEFAULT NULL,
|
||||
bucket_index INT NOT NULL DEFAULT 0,
|
||||
version INT NOT NULL,
|
||||
create_dt timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
update_dt timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
deleted smallint NOT NULL DEFAULT 0,
|
||||
ext_attrs varchar(256) NULL DEFAULT ''
|
||||
);
|
||||
|
||||
|
||||
CREATE INDEX idx_create_dt_workflow ON er_workflow (create_dt);
|
||||
CREATE INDEX idx_namespace_id_group_name_workflow ON er_workflow (namespace_id, group_name);
|
||||
|
||||
COMMENT ON TABLE er_workflow IS '工作流';
|
||||
COMMENT ON COLUMN er_workflow.id IS '主键';
|
||||
COMMENT ON COLUMN er_workflow.workflow_name IS '工作流名称';
|
||||
COMMENT ON COLUMN er_workflow.namespace_id IS '命名空间id';
|
||||
COMMENT ON COLUMN er_workflow.group_name IS '组名称';
|
||||
COMMENT ON COLUMN er_workflow.workflow_status IS '工作流状态 0、关闭、1、开启';
|
||||
COMMENT ON COLUMN er_workflow.trigger_type IS '触发类型 1.CRON 表达式 2. 固定时间';
|
||||
COMMENT ON COLUMN er_workflow.trigger_interval IS '间隔时长';
|
||||
COMMENT ON COLUMN er_workflow.next_trigger_at IS '下次触发时间';
|
||||
COMMENT ON COLUMN er_workflow.block_strategy IS '阻塞策略 1、丢弃 2、覆盖 3、并行';
|
||||
COMMENT ON COLUMN er_workflow.executor_timeout IS '任务执行超时时间,单位秒';
|
||||
COMMENT ON COLUMN er_workflow.description IS '描述';
|
||||
COMMENT ON COLUMN er_workflow.flow_info IS '流程信息';
|
||||
COMMENT ON COLUMN er_workflow.bucket_index IS 'bucket';
|
||||
COMMENT ON COLUMN er_workflow.version IS '版本号';
|
||||
COMMENT ON COLUMN er_workflow.create_dt IS '创建时间';
|
||||
COMMENT ON COLUMN er_workflow.update_dt IS '修改时间';
|
||||
COMMENT ON COLUMN er_workflow.deleted IS '逻辑删除 1、删除';
|
||||
COMMENT ON COLUMN er_workflow.ext_attrs IS '扩展字段';
|
||||
|
||||
CREATE TABLE er_workflow_node
|
||||
(
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
namespace_id VARCHAR(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
|
||||
node_name VARCHAR(64) NOT NULL,
|
||||
group_name VARCHAR(64) NOT NULL,
|
||||
job_id BIGINT NOT NULL,
|
||||
workflow_id BIGINT NOT NULL,
|
||||
node_type SMALLINT NOT NULL DEFAULT 1,
|
||||
expression_type SMALLINT NOT NULL DEFAULT 0,
|
||||
fail_strategy SMALLINT NOT NULL DEFAULT 1,
|
||||
workflow_node_status SMALLINT NOT NULL DEFAULT 1,
|
||||
priority_level INT NOT NULL DEFAULT 1,
|
||||
node_info TEXT DEFAULT NULL,
|
||||
version INT NOT NULL,
|
||||
create_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
update_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
deleted SMALLINT NOT NULL DEFAULT 0,
|
||||
ext_attrs VARCHAR(256) NULL DEFAULT ''
|
||||
);
|
||||
|
||||
CREATE INDEX idx_create_dt_workflow_node ON er_workflow_node (create_dt);
|
||||
CREATE INDEX idx_namespace_id_group_name_workflow_node ON er_workflow_node (namespace_id, group_name);
|
||||
|
||||
COMMENT ON TABLE er_workflow_node IS '工作流节点';
|
||||
COMMENT ON COLUMN er_workflow_node.id IS '主键';
|
||||
COMMENT ON COLUMN er_workflow_node.namespace_id IS '命名空间id';
|
||||
COMMENT ON COLUMN er_workflow_node.node_name IS '节点名称';
|
||||
COMMENT ON COLUMN er_workflow_node.group_name IS '组名称';
|
||||
COMMENT ON COLUMN er_workflow_node.job_id IS '任务信息id';
|
||||
COMMENT ON COLUMN er_workflow_node.workflow_id IS '工作流ID';
|
||||
COMMENT ON COLUMN er_workflow_node.node_type IS '1、任务节点 2、条件节点';
|
||||
COMMENT ON COLUMN er_workflow_node.expression_type IS '1、SpEl、2、Aviator 3、QL';
|
||||
COMMENT ON COLUMN er_workflow_node.fail_strategy IS '失败策略 1、跳过 2、阻塞';
|
||||
COMMENT ON COLUMN er_workflow_node.workflow_node_status IS '工作流节点状态 0、关闭、1、开启';
|
||||
COMMENT ON COLUMN er_workflow_node.priority_level IS '优先级';
|
||||
COMMENT ON COLUMN er_workflow_node.node_info IS '节点信息';
|
||||
COMMENT ON COLUMN er_workflow_node.version IS '版本号';
|
||||
COMMENT ON COLUMN er_workflow_node.create_dt IS '创建时间';
|
||||
COMMENT ON COLUMN er_workflow_node.update_dt IS '修改时间';
|
||||
COMMENT ON COLUMN er_workflow_node.deleted IS '逻辑删除 1、删除';
|
||||
COMMENT ON COLUMN er_workflow_node.ext_attrs IS '扩展字段';
|
||||
|
||||
CREATE TABLE er_workflow_task_batch
|
||||
(
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
namespace_id VARCHAR(64) NOT NULL DEFAULT '764d604ec6fc45f68cd92514c40e9e1a',
|
||||
group_name VARCHAR(64) NOT NULL,
|
||||
workflow_id BIGINT NOT NULL,
|
||||
task_batch_status SMALLINT NOT NULL DEFAULT 0,
|
||||
operation_reason SMALLINT NOT NULL DEFAULT 0,
|
||||
flow_info TEXT DEFAULT NULL,
|
||||
execution_at BIGINT NOT NULL DEFAULT 0,
|
||||
create_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
update_dt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
deleted SMALLINT NOT NULL DEFAULT 0,
|
||||
ext_attrs VARCHAR(256) NULL DEFAULT ''
|
||||
);
|
||||
|
||||
CREATE INDEX idx_job_id_task_batch_status_workflow_task_batch ON er_workflow_task_batch (workflow_id, task_batch_status);
|
||||
CREATE INDEX idx_create_dt_workflow_task_batch ON er_workflow_task_batch (create_dt);
|
||||
CREATE INDEX idx_namespace_id_group_name_workflow_task_batch ON er_workflow_task_batch (namespace_id, group_name);
|
||||
|
||||
COMMENT ON TABLE er_workflow_task_batch IS '工作流批次';
|
||||
COMMENT ON COLUMN er_workflow_task_batch.id IS '主键';
|
||||
COMMENT ON COLUMN er_workflow_task_batch.namespace_id IS '命名空间id';
|
||||
COMMENT ON COLUMN er_workflow_task_batch.group_name IS '组名称';
|
||||
COMMENT ON COLUMN er_workflow_task_batch.workflow_id IS '工作流任务id';
|
||||
COMMENT ON COLUMN er_workflow_task_batch.task_batch_status IS '任务批次状态 0、失败 1、成功';
|
||||
COMMENT ON COLUMN er_workflow_task_batch.operation_reason IS '操作原因';
|
||||
COMMENT ON COLUMN er_workflow_task_batch.flow_info IS '流程信息';
|
||||
COMMENT ON COLUMN er_workflow_task_batch.execution_at IS '任务执行时间';
|
||||
COMMENT ON COLUMN er_workflow_task_batch.create_dt IS '创建时间';
|
||||
COMMENT ON COLUMN er_workflow_task_batch.update_dt IS '修改时间';
|
||||
COMMENT ON COLUMN er_workflow_task_batch.deleted IS '逻辑删除 1、删除';
|
||||
COMMENT ON COLUMN er_workflow_task_batch.ext_attrs IS '扩展字段';
|
@ -126,3 +126,7 @@ COMMENT ON COLUMN "sys_social"."id_token" IS 'id token,部分平台可能没
|
||||
|
||||
-- 数据库超级管理员的role_key由admin修改为SuperAdminRole
|
||||
UPDATE "public"."sys_role" SET "role_key"='SuperAdminRole' WHERE "role_id"=1;
|
||||
|
||||
-- retry server控制台
|
||||
insert into sys_menu values('130', 'EasyRetry控制台', '2', '6', 'easyretry', 'monitor/easyretry/index', '', '1', '0', 'C', '0', '0', 'monitor:easyretry:list', 'job', 103, 1, now(), null, null, 'EasyRetry控制台菜单');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user