update 优化 !pr493 代码结构与问题修复
This commit is contained in:
parent
1b6b74c67b
commit
abe6b05c5c
@ -0,0 +1,53 @@
|
|||||||
|
easy-retry:
|
||||||
|
# 当前使用的数据库类型
|
||||||
|
db-type: mysql
|
||||||
|
spring:
|
||||||
|
datasource:
|
||||||
|
type: com.zaxxer.hikari.HikariDataSource
|
||||||
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||||
|
username: root
|
||||||
|
password: root
|
||||||
|
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,53 @@
|
|||||||
|
easy-retry:
|
||||||
|
# 当前使用的数据库类型
|
||||||
|
db-type: mysql
|
||||||
|
spring:
|
||||||
|
datasource:
|
||||||
|
type: com.zaxxer.hikari.HikariDataSource
|
||||||
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||||
|
username: root
|
||||||
|
password: root
|
||||||
|
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
|
@ -2,26 +2,12 @@ server:
|
|||||||
port: 8800
|
port: 8800
|
||||||
servlet:
|
servlet:
|
||||||
context-path: /easy-retry
|
context-path: /easy-retry
|
||||||
|
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
name: ruoyi-easyretry-server
|
name: ruoyi-easyretry-server
|
||||||
profiles:
|
profiles:
|
||||||
active: @profiles.active@
|
active: @profiles.active@
|
||||||
datasource:
|
|
||||||
name: ry-vue
|
|
||||||
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
|
||||||
username: root
|
|
||||||
password: root
|
|
||||||
type: com.zaxxer.hikari.HikariDataSource
|
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
|
||||||
hikari:
|
|
||||||
connection-timeout: 30000
|
|
||||||
minimum-idle: 5
|
|
||||||
maximum-pool-size: 20
|
|
||||||
auto-commit: true
|
|
||||||
idle-timeout: 30000
|
|
||||||
pool-name: easy_retry
|
|
||||||
max-lifetime: 1800000
|
|
||||||
web:
|
web:
|
||||||
resources:
|
resources:
|
||||||
static-locations: classpath:admin/
|
static-locations: classpath:admin/
|
||||||
@ -37,30 +23,17 @@ mybatis-plus:
|
|||||||
configuration:
|
configuration:
|
||||||
map-underscore-to-camel-case: true
|
map-underscore-to-camel-case: true
|
||||||
cache-enabled: true
|
cache-enabled: true
|
||||||
|
|
||||||
logging:
|
logging:
|
||||||
config: classpath:logback-boot.xml
|
config: classpath:logback-plus.xml
|
||||||
|
|
||||||
easy-retry:
|
management:
|
||||||
retry-pull-page-size: 1000 # 拉取重试数据的每批次的大小
|
endpoints:
|
||||||
job-pull-page-size: 1000 # 拉取重试数据的每批次的大小
|
web:
|
||||||
netty-port: 1788 # 服务端netty端口
|
exposure:
|
||||||
total-partition: 2 # 重试和死信表的分区总数
|
include: '*'
|
||||||
limiter: 1000 # 一个客户端每秒最多接收的重试数量指令
|
endpoint:
|
||||||
step: 100 # 号段模式下步长配置
|
health:
|
||||||
log-storage: 90 # 日志保存时间(单位: day)
|
show-details: ALWAYS
|
||||||
callback: # 回调配置
|
logfile:
|
||||||
max-count: 288 #回调最大执行次数
|
external-file: ./logs/ruoyi-easyretry-server/console.log
|
||||||
trigger-interval: 900 #间隔时间
|
|
||||||
db-type: mysql #当前使用的数据库
|
|
||||||
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,10 @@
|
|||||||
|
Application Version: ${revision}
|
||||||
|
Spring Boot Version: ${spring-boot.version}
|
||||||
|
_
|
||||||
|
| |
|
||||||
|
___ __ _ ___ _ _ ______ _ __ ___| |_ _ __ _ _ ______ ___ ___ _ ____ _____ _ __
|
||||||
|
/ _ \/ _` / __| | | |______| '__/ _ \ __| '__| | | |______/ __|/ _ \ '__\ \ / / _ \ '__|
|
||||||
|
| __/ (_| \__ \ |_| | | | | __/ |_| | | |_| | \__ \ __/ | \ V / __/ |
|
||||||
|
\___|\__,_|___/\__, | |_| \___|\__|_| \__, | |___/\___|_| \_/ \___|_|
|
||||||
|
__/ | __/ |
|
||||||
|
|___/ |___/
|
@ -1,88 +0,0 @@
|
|||||||
<configuration>
|
|
||||||
|
|
||||||
<property name="log.base" value="./logs/ruoyi-easyretry-server" />
|
|
||||||
|
|
||||||
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
|
|
||||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
|
||||||
<Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{256} - %msg%n
|
|
||||||
</Pattern>
|
|
||||||
</encoder>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<appender name="fileInfo"
|
|
||||||
class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
||||||
<file>${log.base}/info.log</file>
|
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
|
||||||
<FileNamePattern>${log.base}/info.%d{yyyy-MM-dd}.log</FileNamePattern>
|
|
||||||
<MaxHistory>30</MaxHistory>
|
|
||||||
</rollingPolicy>
|
|
||||||
<layout class="ch.qos.logback.classic.PatternLayout">
|
|
||||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{256} - %msg%n</pattern>
|
|
||||||
</layout>
|
|
||||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
|
||||||
<level>INFO</level>
|
|
||||||
<onMatch>ACCEPT</onMatch>
|
|
||||||
<onMismatch>DENY</onMismatch>
|
|
||||||
</filter>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<appender name="fileWarn" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
||||||
<file>${log.base}/warn.log</file>
|
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
|
||||||
<FileNamePattern>${log.base}/warn.%d{yyyy-MM-dd}.log
|
|
||||||
</FileNamePattern>
|
|
||||||
<MaxHistory>30</MaxHistory>
|
|
||||||
</rollingPolicy>
|
|
||||||
<layout class="ch.qos.logback.classic.PatternLayout">
|
|
||||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{256} - %msg%n</pattern>
|
|
||||||
</layout>
|
|
||||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
|
||||||
<level>WARN</level>
|
|
||||||
<onMatch>ACCEPT</onMatch>
|
|
||||||
<onMismatch>DENY</onMismatch>
|
|
||||||
</filter>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<appender name="fileError" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
||||||
<file>${log.base}/error.log</file>
|
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
|
||||||
<FileNamePattern>${log.base}/error.%d{yyyy-MM-dd}.log
|
|
||||||
</FileNamePattern>
|
|
||||||
<MaxHistory>30</MaxHistory>
|
|
||||||
</rollingPolicy>
|
|
||||||
<layout class="ch.qos.logback.classic.PatternLayout">
|
|
||||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{256} - %msg%n</pattern>
|
|
||||||
</layout>
|
|
||||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
|
||||||
<level>ERROR</level>
|
|
||||||
<onMatch>ACCEPT</onMatch>
|
|
||||||
<onMismatch>DENY</onMismatch>
|
|
||||||
</filter>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<appender name ="asyncInfo" class= "ch.qos.logback.classic.AsyncAppender">
|
|
||||||
<discardingThreshold >100</discardingThreshold>
|
|
||||||
<queueSize>1024</queueSize>
|
|
||||||
<appender-ref ref ="fileInfo"/>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<appender name ="asyncWarn" class= "ch.qos.logback.classic.AsyncAppender">
|
|
||||||
<discardingThreshold >100</discardingThreshold>
|
|
||||||
<queueSize>1024</queueSize>
|
|
||||||
<appender-ref ref ="fileWarn"/>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<appender name ="asyncError" class= "ch.qos.logback.classic.AsyncAppender">
|
|
||||||
<discardingThreshold >100</discardingThreshold>
|
|
||||||
<queueSize>1024</queueSize>
|
|
||||||
<appender-ref ref ="fileError"/>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- 控制台输出日志级别 -->
|
|
||||||
<root level="info">
|
|
||||||
<appender-ref ref="stdout" />
|
|
||||||
<appender-ref ref="asyncInfo" />
|
|
||||||
<appender-ref ref="asyncWarn" />
|
|
||||||
<appender-ref ref="asyncError" />
|
|
||||||
</root>
|
|
||||||
</configuration>
|
|
@ -0,0 +1,92 @@
|
|||||||
|
<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.base}/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.job.task.support.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>
|
@ -3,18 +3,21 @@ package org.dromara.job.easyretry;
|
|||||||
import com.aizuda.easy.retry.client.job.core.annotation.JobExecutor;
|
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.job.core.dto.JobArgs;
|
||||||
import com.aizuda.easy.retry.client.model.ExecuteResult;
|
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;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author www.byteblogs.com
|
* @author www.byteblogs.com
|
||||||
* @date 2023-09-28 22:54:07
|
* @date 2023-09-28 22:54:07
|
||||||
* @since 2.4.0
|
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
@JobExecutor(name = "testJobExecutor")
|
@JobExecutor(name = "testJobExecutor")
|
||||||
public class TestAnnoJobExecutor {
|
public class TestAnnoJobExecutor {
|
||||||
|
|
||||||
public ExecuteResult jobExecute(JobArgs jobArgs) {
|
public ExecuteResult jobExecute(JobArgs jobArgs) {
|
||||||
|
EasyRetryLog.LOCAL.info("testJobExecutor. jobArgs:{}", JsonUtil.toJsonString(jobArgs));
|
||||||
|
EasyRetryLog.REMOTE.info("testJobExecutor. jobArgs:{}", JsonUtil.toJsonString(jobArgs));
|
||||||
return ExecuteResult.success("测试成功");
|
return ExecuteResult.success("测试成功");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
package org.dromara.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 org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author www.byteblogs.com
|
|
||||||
* @date 2023-09-28 22:54:07
|
|
||||||
* @since 2.4.0
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
@JobExecutor(name = "testAnnoJobExecutorSleep10s")
|
|
||||||
public class TestAnnoJobExecutorSleep10s {
|
|
||||||
|
|
||||||
public ExecuteResult jobExecute(JobArgs jobArgs) {
|
|
||||||
System.out.println(JsonUtil.toJsonString(jobArgs));
|
|
||||||
try {
|
|
||||||
Thread.sleep(10 * 1000);
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
return ExecuteResult.success("测试成功");
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
package org.dromara.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 org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author www.byteblogs.com
|
|
||||||
* @date 2023-09-28 22:54:07
|
|
||||||
* @since 2.4.0
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
@JobExecutor(name = "testAnnoJobExecutorSleep1s")
|
|
||||||
public class TestAnnoJobExecutorSleep1s {
|
|
||||||
|
|
||||||
public ExecuteResult jobExecute(JobArgs jobArgs) {
|
|
||||||
System.out.println(JsonUtil.toJsonString(jobArgs));
|
|
||||||
try {
|
|
||||||
Thread.sleep(1000);
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
return ExecuteResult.success("测试成功");
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
package org.dromara.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 org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author www.byteblogs.com
|
|
||||||
* @date 2023-09-28 22:54:07
|
|
||||||
* @since 2.4.0
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
@JobExecutor(name = "testAnnoJobExecutorSleep30s")
|
|
||||||
public class TestAnnoJobExecutorSleep30s {
|
|
||||||
|
|
||||||
public ExecuteResult jobExecute(JobArgs jobArgs) {
|
|
||||||
System.out.println(JsonUtil.toJsonString(jobArgs));
|
|
||||||
try {
|
|
||||||
Thread.sleep(30 * 1000);
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
return ExecuteResult.success("测试成功");
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,30 +0,0 @@
|
|||||||
package org.dromara.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 lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author www.byteblogs.com
|
|
||||||
* @date 2023-09-28 22:54:07
|
|
||||||
* @since 2.4.0
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
@Slf4j
|
|
||||||
@JobExecutor(name = "testAnnoJobExecutorSleep5s")
|
|
||||||
public class TestAnnoJobExecutorSleep5s {
|
|
||||||
|
|
||||||
public ExecuteResult jobExecute(JobArgs jobArgs) {
|
|
||||||
log.info("testAnnoJobExecutorSleep5s. jobArgs:{}", JsonUtil.toJsonString(jobArgs));
|
|
||||||
|
|
||||||
try {
|
|
||||||
Thread.sleep(5 * 1000);
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
return ExecuteResult.success("测试成功");
|
|
||||||
}
|
|
||||||
}
|
|
@ -8,7 +8,6 @@ import org.springframework.stereotype.Component;
|
|||||||
/**
|
/**
|
||||||
* @author www.byteblogs.com
|
* @author www.byteblogs.com
|
||||||
* @date 2023-09-28 22:54:07
|
* @date 2023-09-28 22:54:07
|
||||||
* @since 2.4.0
|
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
public class TestClassJobExecutor extends AbstractJobExecutor {
|
public class TestClassJobExecutor extends AbstractJobExecutor {
|
||||||
|
@ -16,10 +16,8 @@ CREATE TABLE `namespace`
|
|||||||
) ENGINE = InnoDB
|
) ENGINE = InnoDB
|
||||||
DEFAULT CHARSET = utf8mb4 COMMENT ='命名空间';
|
DEFAULT CHARSET = utf8mb4 COMMENT ='命名空间';
|
||||||
|
|
||||||
INSERT INTO `namespace` (`id`, `name`, `unique_id`, `create_dt`, `update_dt`, `deleted`)
|
INSERT INTO `namespace` VALUES (1, 'Development', 'dev', '', now(), now(), 0);
|
||||||
VALUES (1, 'Development', 'dev', now(), now(), 0);
|
INSERT INTO `namespace` VALUES (2, 'Production', 'prod', '', now(), now(), 0);
|
||||||
INSERT INTO `namespace` (`id`, `name`, `unique_id`, `create_dt`, `update_dt`, `deleted`)
|
|
||||||
VALUES (2, 'Production', 'prod', now(), now(), 0);
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `group_config`;
|
DROP TABLE IF EXISTS `group_config`;
|
||||||
CREATE TABLE `group_config`
|
CREATE TABLE `group_config`
|
||||||
@ -43,8 +41,7 @@ CREATE TABLE `group_config`
|
|||||||
DEFAULT CHARSET = utf8mb4 COMMENT ='组配置'
|
DEFAULT CHARSET = utf8mb4 COMMENT ='组配置'
|
||||||
;
|
;
|
||||||
|
|
||||||
INSERT INTO `ry-vue`.group_config (id, namespace_id, group_name, description, group_status, version, group_partition, id_generator_mode, init_scene, bucket_index, create_dt, update_dt)
|
INSERT INTO `group_config` VALUES (1, 'dev', 'ruoyi_group', '', 1, 1, 0, 1, 1, 4, now(), now());
|
||||||
VALUES (1, 'dev', 'ruoyi_group', '', 1, 1, 0, 1, 1, 4, '2024-03-13 23:21:41', '2024-03-13 23:21:40');
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `notify_config`;
|
DROP TABLE IF EXISTS `notify_config`;
|
||||||
CREATE TABLE `notify_config`
|
CREATE TABLE `notify_config`
|
||||||
@ -254,8 +251,7 @@ CREATE TABLE `system_user`
|
|||||||
DEFAULT CHARSET = utf8mb4 COMMENT ='系统用户表';
|
DEFAULT CHARSET = utf8mb4 COMMENT ='系统用户表';
|
||||||
|
|
||||||
-- pwd: admin
|
-- pwd: admin
|
||||||
INSERT INTO system_user (username, password, role)
|
INSERT INTO `system_user` VALUES (1, 'admin', '465c194afb65670f38322df087f0a9bb225cc257e43eb4ac5a0c98ef5b3173ac', 2, now(), now());
|
||||||
VALUES ('admin', '465c194afb65670f38322df087f0a9bb225cc257e43eb4ac5a0c98ef5b3173ac', 2);
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `system_user_permission`;
|
DROP TABLE IF EXISTS `system_user_permission`;
|
||||||
CREATE TABLE `system_user_permission`
|
CREATE TABLE `system_user_permission`
|
||||||
@ -323,8 +319,7 @@ CREATE TABLE `job`
|
|||||||
AUTO_INCREMENT = 0
|
AUTO_INCREMENT = 0
|
||||||
DEFAULT CHARSET = utf8mb4 COMMENT ='任务信息';
|
DEFAULT CHARSET = utf8mb4 COMMENT ='任务信息';
|
||||||
|
|
||||||
INSERT INTO job (id, namespace_id, group_name, job_name, args_str, args_type, next_trigger_at, job_status, task_type, route_key, executor_type, executor_info, trigger_type, trigger_interval, block_strategy, executor_timeout, max_retry_times, parallel_num, retry_interval, bucket_index, resident, description, ext_attrs, create_dt, update_dt, deleted)
|
INSERT INTO `job` VALUES (1, 'dev', 'ruoyi_group', 'demo-job', null, 1, 1710344035622, 1, 1, 4, 1, 'testJobExecutor', 2, '60', 1, 60, 3, 1, 1, 116, 0, '', '', now(), now(), 0);
|
||||||
VALUES (1, 'dev', 'ruoyi_group', 'demo-job', null, 1, 1710344035622, 1, 1, 4, 1, 'testJobExecutor', 2, '60', 1, 60, 3, 1, 1, 116, 0, '', '', '2024-03-13 22:59:39', '2024-03-13 23:32:52', 0);
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `job_log_message`;
|
DROP TABLE IF EXISTS `job_log_message`;
|
||||||
CREATE TABLE `job_log_message`
|
CREATE TABLE `job_log_message`
|
||||||
|
@ -22,8 +22,8 @@ COMMENT ON COLUMN namespace.update_dt IS '修改时间';
|
|||||||
COMMENT ON COLUMN namespace.deleted IS '逻辑删除 1、删除';
|
COMMENT ON COLUMN namespace.deleted IS '逻辑删除 1、删除';
|
||||||
COMMENT ON TABLE namespace IS '命名空间';
|
COMMENT ON TABLE namespace IS '命名空间';
|
||||||
|
|
||||||
INSERT INTO namespace (name, unique_id, create_dt, update_dt, deleted)
|
INSERT INTO namespace VALUES (1, 'Development', 'dev', '', now(), now(), 0);
|
||||||
VALUES ('Default', '764d604ec6fc45f68cd92514c40e9e1a', now(), now(), 0);
|
INSERT INTO namespace VALUES (2, 'Production', 'prod', '', now(), now(), 0);
|
||||||
|
|
||||||
CREATE TABLE group_config
|
CREATE TABLE group_config
|
||||||
(
|
(
|
||||||
@ -57,10 +57,7 @@ COMMENT ON COLUMN "group_config"."create_dt" IS '创建时间';
|
|||||||
COMMENT ON COLUMN "group_config"."update_dt" IS '修改时间';
|
COMMENT ON COLUMN "group_config"."update_dt" IS '修改时间';
|
||||||
COMMENT ON TABLE "group_config" IS '组配置';
|
COMMENT ON TABLE "group_config" IS '组配置';
|
||||||
|
|
||||||
INSERT INTO `namespace` (`id`, `name`, `unique_id`, `create_dt`, `update_dt`, `deleted`)
|
INSERT INTO group_config VALUES (1, 'dev', 'ruoyi_group', '', 1, 1, 0, 1, 1, 4, now(), now());
|
||||||
VALUES (1, 'Development', 'dev', now(), now(), 0);
|
|
||||||
INSERT INTO `namespace` (`id`, `name`, `unique_id`, `create_dt`, `update_dt`, `deleted`)
|
|
||||||
VALUES (2, 'Production', 'prod', now(), now(), 0);
|
|
||||||
|
|
||||||
CREATE TABLE notify_config
|
CREATE TABLE notify_config
|
||||||
(
|
(
|
||||||
@ -353,8 +350,8 @@ COMMENT ON COLUMN "system_user"."update_dt" IS '修改时间';
|
|||||||
COMMENT ON TABLE "system_user" IS '系统用户表';
|
COMMENT ON TABLE "system_user" IS '系统用户表';
|
||||||
|
|
||||||
-- pwd: admin
|
-- pwd: admin
|
||||||
INSERT INTO system_user (username, password, role)
|
INSERT INTO system_user VALUES (1, 'admin', '465c194afb65670f38322df087f0a9bb225cc257e43eb4ac5a0c98ef5b3173ac', 2, now(), now());
|
||||||
VALUES ('admin', '465c194afb65670f38322df087f0a9bb225cc257e43eb4ac5a0c98ef5b3173ac', 2);
|
|
||||||
|
|
||||||
CREATE TABLE system_user_permission
|
CREATE TABLE system_user_permission
|
||||||
(
|
(
|
||||||
@ -459,8 +456,7 @@ COMMENT ON COLUMN "job"."deleted" IS '逻辑删除 1、删除';
|
|||||||
COMMENT ON COLUMN "job"."update_dt" IS '更新时间';
|
COMMENT ON COLUMN "job"."update_dt" IS '更新时间';
|
||||||
COMMENT ON TABLE "job" IS '任务信息';
|
COMMENT ON TABLE "job" IS '任务信息';
|
||||||
|
|
||||||
INSERT INTO job (id, namespace_id, group_name, job_name, args_str, args_type, next_trigger_at, job_status, task_type, route_key, executor_type, executor_info, trigger_type, trigger_interval, block_strategy, executor_timeout, max_retry_times, parallel_num, retry_interval, bucket_index, resident, description, ext_attrs, create_dt, update_dt, deleted)
|
INSERT INTO job VALUES (1, 'dev', 'ruoyi_group', 'demo-job', null, 1, 1710344035622, 1, 1, 4, 1, 'testJobExecutor', 2, '60', 1, 60, 3, 1, 1, 116, 0, '', '', now(), now(), 0);
|
||||||
VALUES (1, 'dev', 'ruoyi_group', 'demo-job', null, 1, 1710344035622, 1, 1, 4, 1, 'testJobExecutor', 2, '60', 1, 60, 3, 1, 1, 116, 0, '', '', '2024-03-13 22:59:39', '2024-03-13 23:32:52', 0);
|
|
||||||
|
|
||||||
CREATE TABLE job_log_message
|
CREATE TABLE job_log_message
|
||||||
(
|
(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user