refactor: 代码去easy-retry化
This commit is contained in:
parent
44f6bf8672
commit
bbf8924fe4
2
.gitignore
vendored
2
.gitignore
vendored
@ -29,3 +29,5 @@ HELP.md
|
||||
.vscode/
|
||||
|
||||
.flattened-pom.xml
|
||||
|
||||
/data/
|
||||
|
2
pom.xml
2
pom.xml
@ -119,7 +119,7 @@
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>easy-retry-example</finalName>
|
||||
<finalName>snail-job-example</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
@ -1,55 +0,0 @@
|
||||
package com.example.easy.retry.config;
|
||||
|
||||
import com.aizuda.easy.retry.common.core.util.EasyRetryVersion;
|
||||
import io.swagger.v3.oas.models.ExternalDocumentation;
|
||||
import io.swagger.v3.oas.models.OpenAPI;
|
||||
import io.swagger.v3.oas.models.info.Info;
|
||||
import io.swagger.v3.oas.models.info.License;
|
||||
import org.springdoc.core.models.GroupedOpenApi;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
|
||||
/**
|
||||
* @author: www.byteblogs.com
|
||||
* @date : 2023-07-17 18:19
|
||||
* @since 2.1.0
|
||||
*/
|
||||
@Configuration
|
||||
public class SwaggerConfig {
|
||||
|
||||
@Bean
|
||||
public OpenAPI springShopOpenAPI() {
|
||||
return new OpenAPI()
|
||||
.info(new Info()
|
||||
.title("Easy Retry Example")
|
||||
.description("<h1>EasyRetry是致力提高分布式业务系统一致性的分布式重试平台</h1> \n" +
|
||||
"<h3>官网地址: https://www.easyretry.com/</h3>" +
|
||||
"<h3>在线体验地址: http://preview.easyretry.com/</h3> " +
|
||||
"<h3>源码地址: https://gitee.com/byteblogs168/easy-retry-demo</h3>" +
|
||||
"<h3>特别提醒: 🌻在您使用测试案例之前请认真的阅读官网.</h3>")
|
||||
.version(EasyRetryVersion.getVersion())
|
||||
.license(new License().name("Apache 2.0").url("https://www.easyretry.com/")))
|
||||
.externalDocs(new ExternalDocumentation()
|
||||
.description("视频教程:从0到1快速了解分布式重试组件EasyRetry")
|
||||
.url("https://www.ixigua.com/pseries/7272009348824433213/"))
|
||||
;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public GroupedOpenApi adminApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
//分组名
|
||||
.group("user")
|
||||
.pathsToMatch("/**")
|
||||
//扫描路径,将路径下有swagger注解的接口解析到文档中
|
||||
.packagesToScan("com.example.easy.retry.controller")
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,19 +0,0 @@
|
||||
package com.example.easy.retry.listener;
|
||||
|
||||
import com.aizuda.easy.retry.client.common.event.SnailChannelReconnectEvent;
|
||||
import com.aizuda.easy.retry.common.log.EasyRetryLog;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author xiaowoniu
|
||||
* @date 2024-03-14 21:58:18
|
||||
* @since 3.1.0
|
||||
*/
|
||||
@Component
|
||||
public class EasyRetryChannelReconnectListener implements ApplicationListener<SnailChannelReconnectEvent> {
|
||||
@Override
|
||||
public void onApplicationEvent(SnailChannelReconnectEvent event) {
|
||||
EasyRetryLog.LOCAL.info("这个一个重连事件");
|
||||
}
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
package com.example.easy.retry.listener;
|
||||
|
||||
import com.aizuda.easy.retry.client.common.event.SnailClientClosedEvent;
|
||||
import com.aizuda.easy.retry.common.log.EasyRetryLog;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author xiaowoniu
|
||||
* @date 2024-03-14 22:00:58
|
||||
* @since 3.1.0
|
||||
*/
|
||||
@Component
|
||||
public class EasyRetryClosedListener implements ApplicationListener<SnailClientClosedEvent> {
|
||||
@Override
|
||||
public void onApplicationEvent(SnailClientClosedEvent event) {
|
||||
EasyRetryLog.LOCAL.info("这是一个EasyRetry关闭完成事件");
|
||||
}
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
package com.example.easy.retry.listener;
|
||||
|
||||
import com.aizuda.easy.retry.client.common.event.SnailClientClosingEvent;
|
||||
import com.aizuda.easy.retry.common.log.EasyRetryLog;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author xiaowoniu
|
||||
* @date 2024-03-14 22:00:58
|
||||
* @since 3.1.0
|
||||
*/
|
||||
@Component
|
||||
public class EasyRetryClosingListener implements ApplicationListener<SnailClientClosingEvent> {
|
||||
@Override
|
||||
public void onApplicationEvent(SnailClientClosingEvent event) {
|
||||
EasyRetryLog.LOCAL.info("这是一个EasyRetry开始关闭事件");
|
||||
}
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
package com.example.easy.retry.listener;
|
||||
|
||||
import com.aizuda.easy.retry.client.common.event.SnailClientStartedEvent;
|
||||
import com.aizuda.easy.retry.common.log.EasyRetryLog;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author xiaowoniu
|
||||
* @date 2024-03-14 22:00:58
|
||||
* @since 3.1.0
|
||||
*/
|
||||
@Component
|
||||
public class EasyRetryStartedListener implements ApplicationListener<SnailClientStartedEvent> {
|
||||
@Override
|
||||
public void onApplicationEvent(SnailClientStartedEvent event) {
|
||||
EasyRetryLog.LOCAL.info("这是一个EasyRetry启动完成事件");
|
||||
}
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
package com.example.easy.retry.listener;
|
||||
|
||||
import com.aizuda.easy.retry.client.common.event.SnailClientStartingEvent;
|
||||
import com.aizuda.easy.retry.common.log.EasyRetryLog;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author xiaowoniu
|
||||
* @date 2024-03-14 22:00:58
|
||||
* @since 3.1.0
|
||||
*/
|
||||
@Component
|
||||
public class EasyRetryStartingListener implements ApplicationListener<SnailClientStartingEvent> {
|
||||
@Override
|
||||
public void onApplicationEvent(SnailClientStartingEvent event) {
|
||||
EasyRetryLog.LOCAL.info("这是一个EasyRetry启动事件");
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
package com.example.easy.retry;
|
||||
package com.example.snailjob;
|
||||
|
||||
import com.aizuda.easy.retry.client.starter.EnableEasyRetry;
|
||||
import com.aizuda.snailjob.client.starter.EnableSnailJob;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
@ -8,13 +8,13 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import java.util.TimeZone;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableEasyRetry(group = "easy_retry_demo_group")
|
||||
@MapperScan("com.example.easy.retry.dao")
|
||||
public class EasyRetrySpringbootApplication {
|
||||
@EnableSnailJob(group = "snail_job_demo_group")
|
||||
@MapperScan("com.example.snailjob.dao")
|
||||
public class SnailJobSpringbootApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai"));
|
||||
SpringApplication.run(EasyRetrySpringbootApplication.class, args);
|
||||
SpringApplication.run(SnailJobSpringbootApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
55
src/main/java/com/example/snailjob/config/SwaggerConfig.java
Normal file
55
src/main/java/com/example/snailjob/config/SwaggerConfig.java
Normal file
@ -0,0 +1,55 @@
|
||||
package com.example.snailjob.config;
|
||||
|
||||
import com.aizuda.snailjob.common.core.util.SnailJobVersion;
|
||||
import io.swagger.v3.oas.models.ExternalDocumentation;
|
||||
import io.swagger.v3.oas.models.OpenAPI;
|
||||
import io.swagger.v3.oas.models.info.Info;
|
||||
import io.swagger.v3.oas.models.info.License;
|
||||
import org.springdoc.core.models.GroupedOpenApi;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
|
||||
/**
|
||||
* @author: www.byteblogs.com
|
||||
* @date : 2023-07-17 18:19
|
||||
* @since 2.1.0
|
||||
*/
|
||||
@Configuration
|
||||
public class SwaggerConfig {
|
||||
|
||||
@Bean
|
||||
public OpenAPI springShopOpenAPI() {
|
||||
return new OpenAPI()
|
||||
.info(new Info()
|
||||
.title("Snail Job Example")
|
||||
.description("<h1>SnailJob是致力提高分布式业务系统一致性的分布式重试平台</h1> \n" +
|
||||
"<h3>官网地址: https://www.easyretry.com/</h3>" +
|
||||
"<h3>在线体验地址: http://preview.easyretry.com/</h3> " +
|
||||
"<h3>源码地址: https://gitee.com/byteblogs168/easy-retry-demo</h3>" +
|
||||
"<h3>特别提醒: 🌻在您使用测试案例之前请认真的阅读官网.</h3>")
|
||||
.version(SnailJobVersion.getVersion())
|
||||
.license(new License().name("Apache 2.0").url("https://www.easyretry.com/")))
|
||||
.externalDocs(new ExternalDocumentation()
|
||||
.description("视频教程:从0到1快速了解分布式重试组件EasyRetry")
|
||||
.url("https://www.ixigua.com/pseries/7272009348824433213/"))
|
||||
;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public GroupedOpenApi adminApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
//分组名
|
||||
.group("user")
|
||||
.pathsToMatch("/**")
|
||||
//扫描路径,将路径下有swagger注解的接口解析到文档中
|
||||
.packagesToScan("com.example.easy.retry.controller")
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.example.easy.retry.controller;
|
||||
package com.example.snailjob.controller;
|
||||
|
||||
import com.example.easy.retry.service.LocalRemoteService;
|
||||
import com.example.snailjob.service.LocalRemoteService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
@ -1,6 +1,6 @@
|
||||
package com.example.easy.retry.controller;
|
||||
package com.example.snailjob.controller;
|
||||
|
||||
import com.example.easy.retry.vo.OrderVo;
|
||||
import com.example.snailjob.vo.OrderVo;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.example.easy.retry.service.LocalRetryService;
|
||||
import com.example.snailjob.service.LocalRetryService;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/local")
|
@ -1,4 +1,4 @@
|
||||
package com.example.easy.retry.controller;
|
||||
package com.example.snailjob.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.example.easy.retry.service.ManualRetryExecutorMethodService;
|
||||
import com.example.snailjob.service.ManualRetryExecutorMethodService;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/manual")
|
@ -1,4 +1,4 @@
|
||||
package com.example.easy.retry.controller;
|
||||
package com.example.snailjob.controller;
|
||||
|
||||
import java.util.Random;
|
||||
import java.util.UUID;
|
||||
@ -16,8 +16,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.example.easy.retry.vo.OrderVo;
|
||||
import com.example.easy.retry.service.RemoteRetryService;
|
||||
import com.example.snailjob.vo.OrderVo;
|
||||
import com.example.snailjob.service.RemoteRetryService;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/remote")
|
@ -1,6 +1,6 @@
|
||||
package com.example.easy.retry.controller;
|
||||
package com.example.snailjob.controller;
|
||||
|
||||
import com.aizuda.easy.retry.server.model.dto.CallbackParamsDTO;
|
||||
import com.aizuda.snailjob.server.model.dto.CallbackParamsDTO;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpHeaders;
|
@ -1,8 +1,8 @@
|
||||
package com.example.easy.retry.customized;
|
||||
package com.example.snailjob.customized;
|
||||
|
||||
import com.aizuda.easy.retry.client.core.IdempotentIdGenerate;
|
||||
import com.aizuda.easy.retry.common.core.model.IdempotentIdContext;
|
||||
import com.example.easy.retry.vo.OrderVo;
|
||||
import com.aizuda.snailjob.client.core.IdempotentIdGenerate;
|
||||
import com.aizuda.snailjob.common.core.model.IdempotentIdContext;
|
||||
import com.example.snailjob.vo.OrderVo;
|
||||
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
@ -1,13 +1,12 @@
|
||||
package com.example.easy.retry.customized;
|
||||
package com.example.snailjob.customized;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.aizuda.easy.retry.client.core.callback.RetryCompleteCallback;
|
||||
import com.aizuda.easy.retry.common.core.util.JsonUtil;
|
||||
import com.aizuda.snailjob.client.core.callback.RetryCompleteCallback;
|
||||
import com.aizuda.snailjob.common.core.util.JsonUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
import com.example.easy.retry.dao.FailOrderBaseMapper;
|
||||
import com.example.easy.retry.po.FailOrderPo;
|
||||
import com.example.easy.retry.vo.OrderVo;
|
||||
import com.example.snailjob.dao.FailOrderBaseMapper;
|
||||
import com.example.snailjob.po.FailOrderPo;
|
||||
import com.example.snailjob.vo.OrderVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
@ -1,10 +1,8 @@
|
||||
package com.example.easy.retry.customized;
|
||||
package com.example.snailjob.customized;
|
||||
|
||||
import org.apache.catalina.security.SecurityUtil;
|
||||
|
||||
import com.aizuda.easy.retry.client.core.IdempotentIdGenerate;
|
||||
import com.aizuda.easy.retry.common.core.model.IdempotentIdContext;
|
||||
import com.example.easy.retry.vo.OrderVo;
|
||||
import com.aizuda.snailjob.client.core.IdempotentIdGenerate;
|
||||
import com.aizuda.snailjob.common.core.model.IdempotentIdContext;
|
||||
import com.example.snailjob.vo.OrderVo;
|
||||
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
|
@ -1,11 +1,9 @@
|
||||
package com.example.easy.retry.customized;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
package com.example.snailjob.customized;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.aizuda.easy.retry.client.core.strategy.ExecutorMethod;
|
||||
import com.example.easy.retry.vo.OrderVo;
|
||||
import com.aizuda.snailjob.client.core.strategy.ExecutorMethod;
|
||||
import com.example.snailjob.vo.OrderVo;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
@ -1,8 +1,7 @@
|
||||
package com.example.easy.retry.customized;
|
||||
package com.example.snailjob.customized;
|
||||
|
||||
import com.aizuda.easy.retry.client.core.IdempotentIdGenerate;
|
||||
import com.aizuda.easy.retry.common.core.model.IdempotentIdContext;
|
||||
import com.example.easy.retry.vo.OrderVo;
|
||||
import com.aizuda.snailjob.client.core.IdempotentIdGenerate;
|
||||
import com.aizuda.snailjob.common.core.model.IdempotentIdContext;
|
||||
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
|
@ -1,9 +1,9 @@
|
||||
package com.example.easy.retry.dao;
|
||||
package com.example.snailjob.dao;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.example.easy.retry.po.FailOrderPo;
|
||||
import com.example.snailjob.po.FailOrderPo;
|
||||
|
||||
@Repository
|
||||
public interface FailOrderBaseMapper extends BaseMapper<FailOrderPo> {
|
@ -1,4 +1,4 @@
|
||||
package com.example.easy.retry.exception;
|
||||
package com.example.snailjob.exception;
|
||||
|
||||
/**
|
||||
* 业务异常类
|
@ -1,4 +1,4 @@
|
||||
package com.example.easy.retry.exception;
|
||||
package com.example.snailjob.exception;
|
||||
/**
|
||||
* 参数异常处理类
|
||||
*/
|
@ -1,8 +1,8 @@
|
||||
package com.example.easy.retry.executor;
|
||||
package com.example.snailjob.executor;
|
||||
|
||||
import com.aizuda.easy.retry.client.core.annotation.ExecutorMethodRegister;
|
||||
import com.aizuda.easy.retry.client.core.strategy.ExecutorMethod;
|
||||
import com.example.easy.retry.vo.OrderVo;
|
||||
import com.aizuda.snailjob.client.core.annotation.ExecutorMethodRegister;
|
||||
import com.aizuda.snailjob.client.core.strategy.ExecutorMethod;
|
||||
import com.example.snailjob.vo.OrderVo;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
@ -1,8 +1,8 @@
|
||||
package com.example.easy.retry.handler;
|
||||
package com.example.snailjob.handler;
|
||||
|
||||
import com.aizuda.easy.retry.client.core.annotation.Propagation;
|
||||
import com.aizuda.easy.retry.client.core.annotation.Retryable;
|
||||
import com.aizuda.easy.retry.client.core.retryer.RetryType;
|
||||
import com.aizuda.snailjob.client.core.annotation.Propagation;
|
||||
import com.aizuda.snailjob.client.core.annotation.Retryable;
|
||||
import com.aizuda.snailjob.client.core.retryer.RetryType;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Random;
|
@ -1,8 +1,8 @@
|
||||
package com.example.easy.retry.handler;
|
||||
package com.example.snailjob.handler;
|
||||
|
||||
import com.aizuda.easy.retry.client.core.annotation.Propagation;
|
||||
import com.aizuda.easy.retry.client.core.annotation.Retryable;
|
||||
import com.aizuda.easy.retry.client.core.retryer.RetryType;
|
||||
import com.aizuda.snailjob.client.core.annotation.Propagation;
|
||||
import com.aizuda.snailjob.client.core.annotation.Retryable;
|
||||
import com.aizuda.snailjob.client.core.retryer.RetryType;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Random;
|
@ -1,8 +1,8 @@
|
||||
package com.example.easy.retry.handler;
|
||||
package com.example.snailjob.handler;
|
||||
|
||||
import com.aizuda.easy.retry.client.core.annotation.Propagation;
|
||||
import com.aizuda.easy.retry.client.core.annotation.Retryable;
|
||||
import com.aizuda.easy.retry.client.core.retryer.RetryType;
|
||||
import com.aizuda.snailjob.client.core.annotation.Propagation;
|
||||
import com.aizuda.snailjob.client.core.annotation.Retryable;
|
||||
import com.aizuda.snailjob.client.core.retryer.RetryType;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Random;
|
@ -1,8 +1,8 @@
|
||||
package com.example.easy.retry.job;
|
||||
package com.example.snailjob.job;
|
||||
|
||||
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.snailjob.client.job.core.annotation.JobExecutor;
|
||||
import com.aizuda.snailjob.client.job.core.dto.JobArgs;
|
||||
import com.aizuda.snailjob.client.model.ExecuteResult;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
@ -1,9 +1,9 @@
|
||||
package com.example.easy.retry.job;
|
||||
package com.example.snailjob.job;
|
||||
|
||||
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.snailjob.client.job.core.annotation.JobExecutor;
|
||||
import com.aizuda.snailjob.client.job.core.dto.JobArgs;
|
||||
import com.aizuda.snailjob.client.model.ExecuteResult;
|
||||
import com.aizuda.snailjob.common.core.util.JsonUtil;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
@ -1,9 +1,9 @@
|
||||
package com.example.easy.retry.job;
|
||||
package com.example.snailjob.job;
|
||||
|
||||
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.snailjob.client.job.core.annotation.JobExecutor;
|
||||
import com.aizuda.snailjob.client.job.core.dto.JobArgs;
|
||||
import com.aizuda.snailjob.client.model.ExecuteResult;
|
||||
import com.aizuda.snailjob.common.core.util.JsonUtil;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
@ -1,9 +1,9 @@
|
||||
package com.example.easy.retry.job;
|
||||
package com.example.snailjob.job;
|
||||
|
||||
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.snailjob.client.job.core.annotation.JobExecutor;
|
||||
import com.aizuda.snailjob.client.job.core.dto.JobArgs;
|
||||
import com.aizuda.snailjob.client.model.ExecuteResult;
|
||||
import com.aizuda.snailjob.common.core.util.JsonUtil;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
@ -1,9 +1,9 @@
|
||||
package com.example.easy.retry.job;
|
||||
package com.example.snailjob.job;
|
||||
|
||||
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.snailjob.client.job.core.annotation.JobExecutor;
|
||||
import com.aizuda.snailjob.client.job.core.dto.JobArgs;
|
||||
import com.aizuda.snailjob.client.model.ExecuteResult;
|
||||
import com.aizuda.snailjob.common.core.util.JsonUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.example.easy.retry.job;
|
||||
package com.example.snailjob.job;
|
||||
|
||||
/**
|
||||
* @author zhengweilin
|
||||
@ -6,11 +6,11 @@ package com.example.easy.retry.job;
|
||||
* @date 2024/01/22
|
||||
*/
|
||||
|
||||
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.example.easy.retry.po.FailOrderPo;
|
||||
import com.aizuda.snailjob.client.job.core.annotation.JobExecutor;
|
||||
import com.aizuda.snailjob.client.job.core.dto.JobArgs;
|
||||
import com.aizuda.snailjob.client.model.ExecuteResult;
|
||||
import com.aizuda.snailjob.common.core.util.JsonUtil;
|
||||
import com.example.snailjob.po.FailOrderPo;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Random;
|
@ -1,8 +1,8 @@
|
||||
package com.example.easy.retry.job;
|
||||
package com.example.snailjob.job;
|
||||
|
||||
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 com.aizuda.snailjob.client.job.core.dto.JobArgs;
|
||||
import com.aizuda.snailjob.client.job.core.executor.AbstractJobExecutor;
|
||||
import com.aizuda.snailjob.client.model.ExecuteResult;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
@ -1,4 +1,4 @@
|
||||
package com.example.easy.retry.job;
|
||||
package com.example.snailjob.job;
|
||||
|
||||
/**
|
||||
* @author zhengweilin
|
||||
@ -6,10 +6,10 @@ package com.example.easy.retry.job;
|
||||
* @date 2024/01/22
|
||||
*/
|
||||
|
||||
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.example.easy.retry.po.FailOrderPo;
|
||||
import com.aizuda.snailjob.client.job.core.annotation.JobExecutor;
|
||||
import com.aizuda.snailjob.client.job.core.dto.JobArgs;
|
||||
import com.aizuda.snailjob.client.model.ExecuteResult;
|
||||
import com.example.snailjob.po.FailOrderPo;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
@ -1,11 +1,11 @@
|
||||
package com.example.easy.retry.job;
|
||||
package com.example.snailjob.job;
|
||||
|
||||
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 com.example.easy.retry.po.FailOrderPo;
|
||||
import com.aizuda.snailjob.client.job.core.annotation.JobExecutor;
|
||||
import com.aizuda.snailjob.client.job.core.dto.JobArgs;
|
||||
import com.aizuda.snailjob.client.model.ExecuteResult;
|
||||
import com.aizuda.snailjob.common.core.util.JsonUtil;
|
||||
import com.aizuda.snailjob.common.log.SnailJobLog;
|
||||
import com.example.snailjob.po.FailOrderPo;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
@ -19,7 +19,7 @@ public class TestWorkflowAnnoJobExecutor {
|
||||
|
||||
public ExecuteResult jobExecute(JobArgs jobArgs) throws InterruptedException {
|
||||
// for (int i = 0; i < 30; i++) {
|
||||
// EasyRetryLog.REMOTE.info("任务执行开始. [{}]", i + "" + JsonUtil.toJsonString(jobArgs));
|
||||
// SnailJobLog.REMOTE.info("任务执行开始. [{}]", i + "" + JsonUtil.toJsonString(jobArgs));
|
||||
// }
|
||||
FailOrderPo failOrderPo = new FailOrderPo();
|
||||
failOrderPo.setOrderId("xiaowoniu");
|
@ -0,0 +1,19 @@
|
||||
package com.example.snailjob.listener;
|
||||
|
||||
import com.aizuda.snailjob.client.common.event.SnailChannelReconnectEvent;
|
||||
import com.aizuda.snailjob.common.log.SnailJobLog;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author xiaowoniu
|
||||
* @date 2024-03-14 21:58:18
|
||||
* @since 3.1.0
|
||||
*/
|
||||
@Component
|
||||
public class SnailJobChannelReconnectListener implements ApplicationListener<SnailChannelReconnectEvent> {
|
||||
@Override
|
||||
public void onApplicationEvent(SnailChannelReconnectEvent event) {
|
||||
SnailJobLog.LOCAL.info("这个一个重连事件");
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.example.snailjob.listener;
|
||||
|
||||
import com.aizuda.snailjob.client.common.event.SnailClientClosedEvent;
|
||||
import com.aizuda.snailjob.common.log.SnailJobLog;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author xiaowoniu
|
||||
* @date 2024-03-14 22:00:58
|
||||
* @since 3.1.0
|
||||
*/
|
||||
@Component
|
||||
public class SnailJobClosedListener implements ApplicationListener<SnailClientClosedEvent> {
|
||||
@Override
|
||||
public void onApplicationEvent(SnailClientClosedEvent event) {
|
||||
SnailJobLog.LOCAL.info("这是一个SnailJob关闭完成事件");
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.example.snailjob.listener;
|
||||
|
||||
import com.aizuda.snailjob.client.common.event.SnailClientClosingEvent;
|
||||
import com.aizuda.snailjob.common.log.SnailJobLog;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author xiaowoniu
|
||||
* @date 2024-03-14 22:00:58
|
||||
* @since 3.1.0
|
||||
*/
|
||||
@Component
|
||||
public class SnailJobClosingListener implements ApplicationListener<SnailClientClosingEvent> {
|
||||
@Override
|
||||
public void onApplicationEvent(SnailClientClosingEvent event) {
|
||||
SnailJobLog.LOCAL.info("这是一个SnailJob开始关闭事件");
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.example.snailjob.listener;
|
||||
|
||||
import com.aizuda.snailjob.client.common.event.SnailClientStartedEvent;
|
||||
import com.aizuda.snailjob.common.log.SnailJobLog;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author xiaowoniu
|
||||
* @date 2024-03-14 22:00:58
|
||||
* @since 3.1.0
|
||||
*/
|
||||
@Component
|
||||
public class SnailJobStartedListener implements ApplicationListener<SnailClientStartedEvent> {
|
||||
@Override
|
||||
public void onApplicationEvent(SnailClientStartedEvent event) {
|
||||
SnailJobLog.LOCAL.info("这是一个SnailJob启动完成事件");
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.example.snailjob.listener;
|
||||
|
||||
import com.aizuda.snailjob.client.common.event.SnailClientStartingEvent;
|
||||
import com.aizuda.snailjob.common.log.SnailJobLog;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author xiaowoniu
|
||||
* @date 2024-03-14 22:00:58
|
||||
* @since 3.1.0
|
||||
*/
|
||||
@Component
|
||||
public class SnailJobStartingListener implements ApplicationListener<SnailClientStartingEvent> {
|
||||
@Override
|
||||
public void onApplicationEvent(SnailClientStartingEvent event) {
|
||||
SnailJobLog.LOCAL.info("这是一个SnailJob启动事件");
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.example.easy.retry.po;
|
||||
package com.example.snailjob.po;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.example.easy.retry.service;
|
||||
package com.example.snailjob.service;
|
||||
|
||||
/**
|
||||
* @author: www.byteblogs.com
|
@ -1,8 +1,8 @@
|
||||
package com.example.easy.retry.service;
|
||||
package com.example.snailjob.service;
|
||||
|
||||
import com.aizuda.easy.retry.client.core.annotation.Retryable;
|
||||
import com.aizuda.easy.retry.client.core.retryer.RetryType;
|
||||
import com.example.easy.retry.vo.OrderVo;
|
||||
import com.aizuda.snailjob.client.core.annotation.Retryable;
|
||||
import com.aizuda.snailjob.client.core.retryer.RetryType;
|
||||
import com.example.snailjob.vo.OrderVo;
|
||||
|
||||
/**
|
||||
* @author: www.byteblogs.com
|
@ -1,4 +1,4 @@
|
||||
package com.example.easy.retry.service;
|
||||
package com.example.snailjob.service;
|
||||
|
||||
/**
|
||||
* @author: www.byteblogs.com
|
@ -1,6 +1,6 @@
|
||||
package com.example.easy.retry.service;
|
||||
package com.example.snailjob.service;
|
||||
|
||||
import com.example.easy.retry.vo.OrderVo;
|
||||
import com.example.snailjob.vo.OrderVo;
|
||||
|
||||
/**
|
||||
* @author: www.byteblogs.com
|
@ -1,9 +1,9 @@
|
||||
package com.example.easy.retry.service.impl;
|
||||
package com.example.snailjob.service.impl;
|
||||
|
||||
import com.aizuda.easy.retry.client.core.annotation.Retryable;
|
||||
import com.aizuda.easy.retry.client.core.retryer.RetryType;
|
||||
import com.example.easy.retry.handler.LocalAndRemoteRetryHandler;
|
||||
import com.example.easy.retry.service.LocalRemoteService;
|
||||
import com.aizuda.snailjob.client.core.annotation.Retryable;
|
||||
import com.aizuda.snailjob.client.core.retryer.RetryType;
|
||||
import com.example.snailjob.handler.LocalAndRemoteRetryHandler;
|
||||
import com.example.snailjob.service.LocalRemoteService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
@ -1,19 +1,19 @@
|
||||
package com.example.easy.retry.service.impl;
|
||||
package com.example.snailjob.service.impl;
|
||||
|
||||
import com.aizuda.easy.retry.client.core.retryer.RetryType;
|
||||
import com.example.easy.retry.customized.OrderRetryMethod;
|
||||
import com.example.easy.retry.handler.OnlyLocalRetryHandler;
|
||||
import com.example.easy.retry.service.LocalRetryService;
|
||||
import com.example.easy.retry.vo.OrderVo;
|
||||
import com.aizuda.snailjob.client.core.retryer.RetryType;
|
||||
import com.example.snailjob.customized.OrderRetryMethod;
|
||||
import com.example.snailjob.handler.OnlyLocalRetryHandler;
|
||||
import com.example.snailjob.service.LocalRetryService;
|
||||
import com.example.snailjob.vo.OrderVo;
|
||||
import com.example.snailjob.exception.ParamException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.aizuda.easy.retry.client.core.annotation.Retryable;
|
||||
import com.example.easy.retry.exception.ParamException;
|
||||
import com.aizuda.snailjob.client.core.annotation.Retryable;
|
||||
|
||||
/**
|
||||
* easy-retry中的本地重试demo
|
||||
* snail-job中的本地重试demo
|
||||
*/
|
||||
|
||||
@Component
|
@ -1,15 +1,14 @@
|
||||
package com.example.easy.retry.service.impl;
|
||||
package com.example.snailjob.service.impl;
|
||||
|
||||
import com.example.easy.retry.service.ManualRetryExecutorMethodService;
|
||||
import com.aizuda.snailjob.client.core.retryer.RetryTaskTemplateBuilder;
|
||||
import com.aizuda.snailjob.client.core.retryer.SnailJobTemplate;
|
||||
import com.example.snailjob.executor.ManualRetryExecutorTask;
|
||||
import com.example.snailjob.service.ManualRetryExecutorMethodService;
|
||||
import com.example.snailjob.vo.OrderVo;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.aizuda.easy.retry.client.core.retryer.EasyRetryTemplate;
|
||||
import com.aizuda.easy.retry.client.core.retryer.RetryTaskTemplateBuilder;
|
||||
import com.example.easy.retry.executor.ManualRetryExecutorTask;
|
||||
import com.example.easy.retry.vo.OrderVo;
|
||||
|
||||
/**
|
||||
* easy-retry中的手动重试
|
||||
* snail-job中的手动重试
|
||||
*/
|
||||
@Component
|
||||
public class ManualRetryExecutorMethodServiceImpl implements ManualRetryExecutorMethodService {
|
||||
@ -19,7 +18,7 @@ public class ManualRetryExecutorMethodServiceImpl implements ManualRetryExecutor
|
||||
.orderId(params)
|
||||
.source(1)
|
||||
.build();
|
||||
EasyRetryTemplate easyRetryTemplate = RetryTaskTemplateBuilder.newBuilder()
|
||||
SnailJobTemplate snailJobTemplate = RetryTaskTemplateBuilder.newBuilder()
|
||||
// 手动指定场景名称
|
||||
.withScene(ManualRetryExecutorTask.SCENE)
|
||||
// 指定要执行的任务
|
||||
@ -28,7 +27,7 @@ public class ManualRetryExecutorMethodServiceImpl implements ManualRetryExecutor
|
||||
.withParam(orderVo)
|
||||
.build();
|
||||
// 执行模板
|
||||
easyRetryTemplate.executeRetry();
|
||||
snailJobTemplate.executeRetry();
|
||||
}
|
||||
|
||||
}
|
@ -1,28 +1,27 @@
|
||||
package com.example.easy.retry.service.impl;
|
||||
package com.example.snailjob.service.impl;
|
||||
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.aizuda.easy.retry.client.core.intercepter.RetrySiteSnapshot;
|
||||
import com.aizuda.easy.retry.common.core.enums.RetryStatusEnum;
|
||||
import com.example.easy.retry.handler.OnlyRemoteRetryHandler;
|
||||
import com.example.easy.retry.service.RemoteRetryService;
|
||||
import com.aizuda.snailjob.client.core.intercepter.RetrySiteSnapshot;
|
||||
import com.aizuda.snailjob.common.core.enums.RetryStatusEnum;
|
||||
import com.example.snailjob.handler.OnlyRemoteRetryHandler;
|
||||
import com.example.snailjob.service.RemoteRetryService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.aizuda.easy.retry.client.core.annotation.Retryable;
|
||||
import com.aizuda.easy.retry.client.core.retryer.RetryType;
|
||||
import com.example.easy.retry.customized.MultiParamIdempotentGenerate;
|
||||
import com.example.easy.retry.customized.OrderIdempotentIdGenerate;
|
||||
import com.example.easy.retry.customized.OrderCompleteCallback;
|
||||
import com.example.easy.retry.customized.OrderRetryMethod;
|
||||
import com.example.easy.retry.customized.SingleParamIdempotentGenerate;
|
||||
import com.example.easy.retry.vo.OrderVo;
|
||||
import com.aizuda.snailjob.client.core.annotation.Retryable;
|
||||
import com.aizuda.snailjob.client.core.retryer.RetryType;
|
||||
import com.example.snailjob.customized.MultiParamIdempotentGenerate;
|
||||
import com.example.snailjob.customized.OrderIdempotentIdGenerate;
|
||||
import com.example.snailjob.customized.OrderCompleteCallback;
|
||||
import com.example.snailjob.customized.OrderRetryMethod;
|
||||
import com.example.snailjob.customized.SingleParamIdempotentGenerate;
|
||||
import com.example.snailjob.vo.OrderVo;
|
||||
|
||||
/**
|
||||
* easy-retry中的远程重试
|
||||
* snail-job中的远程重试
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
@ -1,7 +1,7 @@
|
||||
package com.example.easy.retry.spi;
|
||||
package com.example.snailjob.spi;
|
||||
|
||||
import com.aizuda.easy.retry.client.core.event.EasyRetryListener;
|
||||
import com.aizuda.easy.retry.common.core.util.JsonUtil;
|
||||
import com.aizuda.snailjob.client.core.event.SnailJobListener;
|
||||
import com.aizuda.snailjob.common.core.util.JsonUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
@ -9,7 +9,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
* @date : 2023-08-28 11:20
|
||||
*/
|
||||
@Slf4j
|
||||
public class MyEasyRetryListener implements EasyRetryListener {
|
||||
public class MySnailJobListener implements SnailJobListener {
|
||||
|
||||
@Override
|
||||
public void beforeRetry(final String sceneName, final String executorClassName, final Object[] params) {
|
@ -1,6 +1,6 @@
|
||||
package com.example.easy.retry.spi;
|
||||
package com.example.snailjob.spi;
|
||||
|
||||
import com.aizuda.easy.retry.client.core.RetrySiteSnapshotContext;
|
||||
import com.aizuda.snailjob.client.core.RetrySiteSnapshotContext;
|
||||
import com.alibaba.ttl.TransmittableThreadLocal;
|
||||
|
||||
/**
|
@ -1,6 +1,4 @@
|
||||
package com.example.easy.retry.util;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
package com.example.snailjob.util;
|
||||
|
||||
import com.baomidou.mybatisplus.generator.AutoGenerator;
|
||||
import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
|
||||
@ -10,37 +8,37 @@ import com.baomidou.mybatisplus.generator.config.StrategyConfig;
|
||||
|
||||
public class CodeGen {
|
||||
|
||||
private static String dataSourceUrl = "jdbc:mysql://localhost:3306/easy_retry_260?useSSL=false&characterEncoding=utf8&useUnicode=true";
|
||||
private static String dataSourceUrl = "jdbc:mysql://localhost:3306/snail_job_260?useSSL=false&characterEncoding=utf8&useUnicode=true";
|
||||
|
||||
private static String userName = "root";
|
||||
|
||||
private static String password= "root";
|
||||
private static String password = "root";
|
||||
|
||||
public static void main(String[] args) {
|
||||
DataSourceConfig dataSourceConfig = new DataSourceConfig.Builder(dataSourceUrl, userName, password).build();
|
||||
|
||||
// 全局配置
|
||||
GlobalConfig globalConfig = new GlobalConfig.Builder()
|
||||
.outputDir("src/main/java")
|
||||
.author("xiaowoniu")
|
||||
.build();
|
||||
.outputDir("src/main/java")
|
||||
.author("xiaowoniu")
|
||||
.build();
|
||||
|
||||
// 策略配置
|
||||
StrategyConfig strategyConfig = new StrategyConfig.Builder()
|
||||
.addInclude("workflow") // 需要生成的表名
|
||||
.build();
|
||||
.addInclude("workflow") // 需要生成的表名
|
||||
.build();
|
||||
|
||||
// 包配置
|
||||
PackageConfig packageConfig = new PackageConfig.Builder()
|
||||
.parent("com.aizuda.easy.retry.template.datasource.persistence.po")
|
||||
.moduleName("easy-retry-springboot")
|
||||
.build();
|
||||
.parent("com.aizuda.snailjob.template.datasource.persistence.po")
|
||||
.moduleName("snail-job-springboot")
|
||||
.build();
|
||||
|
||||
// 代码生成器
|
||||
AutoGenerator generator = new AutoGenerator(dataSourceConfig)
|
||||
.global(globalConfig)
|
||||
.strategy(strategyConfig)
|
||||
.packageInfo(packageConfig);
|
||||
.global(globalConfig)
|
||||
.strategy(strategyConfig)
|
||||
.packageInfo(packageConfig);
|
||||
|
||||
// 执行生成代码
|
||||
generator.execute();
|
@ -1,4 +1,4 @@
|
||||
package com.example.easy.retry.vo;
|
||||
package com.example.snailjob.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
@ -1,2 +0,0 @@
|
||||
com.aizuda.easy.retry.client.core.expression.QLExpressEngine
|
||||
#com.aizuda.easy.retry.client.core.expression.AviatorExpressionEngine
|
@ -1 +0,0 @@
|
||||
#com.aizuda.easy.retry.client.core.serializer.HessianSerializer
|
@ -1 +0,0 @@
|
||||
#com.example.easy.retry.spi.TTLRetrySiteSnapshotContext
|
@ -1 +0,0 @@
|
||||
#com.example.easy.retry.spi.MyEasyRetryListener
|
@ -0,0 +1,2 @@
|
||||
#com.aizuda.snailjob.client.core.expression.QLExpressEngine
|
||||
#com.aizuda.snailjob.client.core.expression.AviatorExpressionEngine
|
@ -0,0 +1 @@
|
||||
#com.aizuda.snailjob.client.core.serializer.HessianSerializer
|
@ -0,0 +1 @@
|
||||
#spi.com.example.snail.job.TTLRetrySiteSnapshotContext
|
@ -0,0 +1 @@
|
||||
#spi.com.example.snail.job.MySnailJobListener
|
@ -1,5 +1,6 @@
|
||||
server:
|
||||
port: 8018
|
||||
|
||||
spring:
|
||||
mvc:
|
||||
pathmatch:
|
||||
@ -7,8 +8,8 @@ spring:
|
||||
profiles:
|
||||
active: dev
|
||||
datasource:
|
||||
name: easy_retry
|
||||
url: jdbc:mysql://localhost:3306/easy_retry_260?useSSL=false&characterEncoding=utf8&useUnicode=true
|
||||
name: snail_job
|
||||
url: jdbc:mysql://localhost:3306/snail_job_260?useSSL=false&characterEncoding=utf8&useUnicode=true
|
||||
username: root
|
||||
password: root
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
@ -22,9 +23,10 @@ spring:
|
||||
pool-name: demo
|
||||
max-lifetime: 1800000
|
||||
connection-test-query: SELECT 1
|
||||
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath:/mapper/*.xml
|
||||
typeAliasesPackage: com.example.easy.retry.po
|
||||
typeAliasesPackage: com.example.snail.job.po
|
||||
global-config:
|
||||
db-config:
|
||||
field-strategy: NOT_EMPTY
|
||||
@ -43,4 +45,4 @@ snail-job:
|
||||
host: 127.0.0.1
|
||||
port: 1788
|
||||
namespace: 764d604ec6fc45f68cd92514c40e9e1a
|
||||
token: ER_Wyz3dmsdbDOkDujOTSSoBjGQP1BMsVnj
|
||||
token: SJ_Wyz3dmsdbDOkDujOTSSoBjGQP1BMsVnj
|
||||
|
@ -1,6 +1,6 @@
|
||||
<configuration>
|
||||
|
||||
<property name="log.base" value="easy-retry-demo" />
|
||||
<property name="log.base" value="snail-job-demo" />
|
||||
|
||||
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
@ -79,7 +79,7 @@
|
||||
</appender>
|
||||
|
||||
<!-- Snail appender -->
|
||||
<appender name="snailLogAppender" class="com.aizuda.easy.retry.client.common.appender.SnailLogbackAppender">
|
||||
<appender name="snailLogAppender" class="com.aizuda.snailjob.client.common.appender.SnailLogbackAppender">
|
||||
</appender>
|
||||
|
||||
<!-- 控制台输出日志级别 -->
|
||||
|
Loading…
Reference in New Issue
Block a user