Merge remote-tracking branch 'origin/master' into master-jdk8
# Conflicts: # pom.xml # src/main/resources/application.yml
This commit is contained in:
commit
64d39e19f3
33
pom.xml
33
pom.xml
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
<snailjob.version>1.3.0-beta1.1-jdk8</snailjob.version>
|
<snailjob.version>1.5.0-beta1-jdk8</snailjob.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
@ -67,6 +67,11 @@
|
|||||||
<artifactId>QLExpress</artifactId>
|
<artifactId>QLExpress</artifactId>
|
||||||
<version>3.3.1</version>
|
<version>3.3.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.baomidou</groupId>
|
||||||
|
<artifactId>mybatis-plus-spring-boot3-starter</artifactId>
|
||||||
|
<version>3.5.7</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.baomidou</groupId>
|
<groupId>com.baomidou</groupId>
|
||||||
<artifactId>mybatis-plus-generator</artifactId>
|
<artifactId>mybatis-plus-generator</artifactId>
|
||||||
@ -80,12 +85,17 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.hutool</groupId>
|
<groupId>cn.hutool</groupId>
|
||||||
<artifactId>hutool-all</artifactId>
|
<artifactId>hutool-all</artifactId>
|
||||||
<version>5.8.23</version>
|
<version>5.8.19</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.mysql</groupId>
|
<groupId>mysql</groupId>
|
||||||
<artifactId>mysql-connector-j</artifactId>
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
<version>8.4.0</version>
|
<version>8.0.30</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springdoc</groupId>
|
||||||
|
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||||||
|
<version>2.2.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba</groupId>
|
<groupId>com.alibaba</groupId>
|
||||||
@ -112,19 +122,6 @@
|
|||||||
<artifactId>fastjson</artifactId>
|
<artifactId>fastjson</artifactId>
|
||||||
<version>1.2.83</version>
|
<version>1.2.83</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- jdk8 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springdoc</groupId>
|
|
||||||
<artifactId>springdoc-openapi-ui</artifactId>
|
|
||||||
<version>1.8.0</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.baomidou</groupId>
|
|
||||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
|
||||||
<version>3.5.7</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package com.example.snailjob.customized;
|
package com.example.snailjob.customized;
|
||||||
|
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.aizuda.snailjob.client.core.callback.RetryCompleteCallback;
|
import com.aizuda.snailjob.client.core.callback.complete.RetryCompleteCallback;
|
||||||
import com.aizuda.snailjob.common.core.util.JsonUtil;
|
import com.aizuda.snailjob.common.core.util.JsonUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.example.snailjob.dao.FailOrderBaseMapper;
|
import com.example.snailjob.dao.FailOrderBaseMapper;
|
||||||
|
@ -45,13 +45,13 @@ public class OnlyRemoteRetryHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Retryable(scene = "localRetryWithRequires", retryStrategy = RetryType.ONLY_LOCAL)
|
@Retryable(scene = "localRetryWithRequires", retryStrategy = RetryType.ONLY_REMOTE)
|
||||||
public void localRetryWithRequires(String params) {
|
public void localRetryWithRequires(String params) {
|
||||||
System.out.println("local retry 方法开始执行");
|
System.out.println("local retry 方法开始执行");
|
||||||
double i = 1 / 0;
|
double i = 1 / 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Retryable(scene = "localRetryWithRequiresNew", retryStrategy = RetryType.ONLY_LOCAL, propagation = Propagation.REQUIRES_NEW)
|
@Retryable(scene = "localRetryWithRequiresNew", retryStrategy = RetryType.ONLY_REMOTE, propagation = Propagation.REQUIRES_NEW)
|
||||||
public void localRetryWithRequiresNew(String params) {
|
public void localRetryWithRequiresNew(String params) {
|
||||||
System.out.println("local retry 方法开始执行");
|
System.out.println("local retry 方法开始执行");
|
||||||
double i = 1 / 0;
|
double i = 1 / 0;
|
||||||
|
@ -3,7 +3,7 @@ package com.example.snailjob.handler;
|
|||||||
import com.aizuda.snailjob.client.job.core.enums.AllocationAlgorithmEnum;
|
import com.aizuda.snailjob.client.job.core.enums.AllocationAlgorithmEnum;
|
||||||
import com.aizuda.snailjob.client.job.core.enums.TriggerTypeEnum;
|
import com.aizuda.snailjob.client.job.core.enums.TriggerTypeEnum;
|
||||||
import com.aizuda.snailjob.client.job.core.openapi.SnailJobOpenApi;
|
import com.aizuda.snailjob.client.job.core.openapi.SnailJobOpenApi;
|
||||||
import com.aizuda.snailjob.common.core.enums.BlockStrategyEnum;
|
import com.aizuda.snailjob.common.core.enums.JobBlockStrategyEnum;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@ -22,7 +22,7 @@ public class TestAddJobHandler {
|
|||||||
.setExecutorInfo("testJobExecutor")
|
.setExecutorInfo("testJobExecutor")
|
||||||
.setExecutorTimeout(30)
|
.setExecutorTimeout(30)
|
||||||
.setDescription("add")
|
.setDescription("add")
|
||||||
.setBlockStrategy(BlockStrategyEnum.DISCARD)
|
.setBlockStrategy(JobBlockStrategyEnum.DISCARD)
|
||||||
.setMaxRetryTimes(1)
|
.setMaxRetryTimes(1)
|
||||||
.setTriggerType(TriggerTypeEnum.SCHEDULED_TIME)
|
.setTriggerType(TriggerTypeEnum.SCHEDULED_TIME)
|
||||||
.setTriggerInterval(String.valueOf(60))
|
.setTriggerInterval(String.valueOf(60))
|
||||||
@ -45,7 +45,7 @@ public class TestAddJobHandler {
|
|||||||
.setExecutorInfo("testJobExecutor")
|
.setExecutorInfo("testJobExecutor")
|
||||||
.setExecutorTimeout(30)
|
.setExecutorTimeout(30)
|
||||||
.setDescription("add")
|
.setDescription("add")
|
||||||
.setBlockStrategy(BlockStrategyEnum.DISCARD)
|
.setBlockStrategy(JobBlockStrategyEnum.DISCARD)
|
||||||
.setMaxRetryTimes(1)
|
.setMaxRetryTimes(1)
|
||||||
.setTriggerType(TriggerTypeEnum.CRON)
|
.setTriggerType(TriggerTypeEnum.CRON)
|
||||||
.setTriggerInterval("afas")
|
.setTriggerInterval("afas")
|
||||||
@ -68,7 +68,7 @@ public class TestAddJobHandler {
|
|||||||
.setExecutorInfo("testJobExecutor")
|
.setExecutorInfo("testJobExecutor")
|
||||||
.setExecutorTimeout(30)
|
.setExecutorTimeout(30)
|
||||||
.setDescription("add")
|
.setDescription("add")
|
||||||
.setBlockStrategy(BlockStrategyEnum.DISCARD)
|
.setBlockStrategy(JobBlockStrategyEnum.DISCARD)
|
||||||
.setMaxRetryTimes(1)
|
.setMaxRetryTimes(1)
|
||||||
.setTriggerType(TriggerTypeEnum.SCHEDULED_TIME)
|
.setTriggerType(TriggerTypeEnum.SCHEDULED_TIME)
|
||||||
.setTriggerInterval(60)
|
.setTriggerInterval(60)
|
||||||
@ -91,7 +91,7 @@ public class TestAddJobHandler {
|
|||||||
.setExecutorInfo("testJobExecutor")
|
.setExecutorInfo("testJobExecutor")
|
||||||
.setExecutorTimeout(30)
|
.setExecutorTimeout(30)
|
||||||
.setDescription("add")
|
.setDescription("add")
|
||||||
.setBlockStrategy(BlockStrategyEnum.DISCARD)
|
.setBlockStrategy(JobBlockStrategyEnum.DISCARD)
|
||||||
.setMaxRetryTimes(1)
|
.setMaxRetryTimes(1)
|
||||||
.setTriggerType(TriggerTypeEnum.SCHEDULED_TIME)
|
.setTriggerType(TriggerTypeEnum.SCHEDULED_TIME)
|
||||||
.setTriggerInterval(String.valueOf(60))
|
.setTriggerInterval(String.valueOf(60))
|
||||||
@ -113,7 +113,7 @@ public class TestAddJobHandler {
|
|||||||
.setExecutorInfo("testJobExecutor")
|
.setExecutorInfo("testJobExecutor")
|
||||||
.setExecutorTimeout(30)
|
.setExecutorTimeout(30)
|
||||||
.setDescription("add")
|
.setDescription("add")
|
||||||
.setBlockStrategy(BlockStrategyEnum.DISCARD)
|
.setBlockStrategy(JobBlockStrategyEnum.DISCARD)
|
||||||
.setMaxRetryTimes(1)
|
.setMaxRetryTimes(1)
|
||||||
.setTriggerType(TriggerTypeEnum.SCHEDULED_TIME)
|
.setTriggerType(TriggerTypeEnum.SCHEDULED_TIME)
|
||||||
.setTriggerInterval(String.valueOf(60))
|
.setTriggerInterval(String.valueOf(60))
|
||||||
|
@ -12,8 +12,8 @@ public class TestTriggerJobHandler {
|
|||||||
* @param jobId 任务ID
|
* @param jobId 任务ID
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Boolean triggerJob(Long jobId){
|
public Boolean triggerJob(Long jobId) {
|
||||||
return SnailJobOpenApi.triggerJob(jobId).execute();
|
return SnailJobOpenApi.triggerClusterJob(jobId).execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -58,4 +58,4 @@ snail-job:
|
|||||||
# 客户端通讯端口,默认 17889
|
# 客户端通讯端口,默认 17889
|
||||||
port: 17889
|
port: 17889
|
||||||
# rpc通讯方式: netty, grpc
|
# rpc通讯方式: netty, grpc
|
||||||
rpc-type: netty
|
rpc-type: grpc
|
||||||
|
Loading…
Reference in New Issue
Block a user