fix: 1.2.0

1.手动保存数据失败问题
This commit is contained in:
www.byteblogs.com 2023-05-08 22:44:54 +08:00
parent 4b9341489e
commit 7c01a49e0c
18 changed files with 34 additions and 6 deletions

View File

@ -7,11 +7,14 @@ import com.aizuda.easy.retry.common.core.model.Result;
import com.aizuda.easy.retry.server.config.RequestDataHelper;
import com.aizuda.easy.retry.server.exception.EasyRetryServerException;
import com.aizuda.easy.retry.server.persistence.mybatis.mapper.RetryTaskMapper;
import com.aizuda.easy.retry.server.persistence.mybatis.po.GroupConfig;
import com.aizuda.easy.retry.server.persistence.mybatis.po.RetryTask;
import com.aizuda.easy.retry.server.persistence.mybatis.po.ServerNode;
import com.aizuda.easy.retry.server.persistence.support.ConfigAccess;
import com.aizuda.easy.retry.server.service.RetryTaskService;
import com.aizuda.easy.retry.server.service.convert.RetryTaskConverter;
import com.aizuda.easy.retry.server.service.convert.RetryTaskResponseVOConverter;
import com.aizuda.easy.retry.server.support.generator.IdGenerator;
import com.aizuda.easy.retry.server.support.handler.ClientNodeAllocateHandler;
import com.aizuda.easy.retry.server.support.strategy.WaitStrategies;
import com.aizuda.easy.retry.server.web.model.base.PageResult;
@ -27,6 +30,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.http.HttpEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
@ -46,7 +50,7 @@ import java.util.concurrent.TimeUnit;
@Service
public class RetryTaskServiceImpl implements RetryTaskService {
public static final String URL = "http://{0}:{1}/{2}/retry/generate/biz-id/v1";
public static final String URL = "http://{0}:{1}/{2}/retry/generate/idempotent-id/v1";
@Autowired
private RetryTaskMapper retryTaskMapper;
@ -54,6 +58,12 @@ public class RetryTaskServiceImpl implements RetryTaskService {
private RestTemplate restTemplate;
@Autowired
private ClientNodeAllocateHandler clientNodeAllocateHandler;
@Autowired
private List<IdGenerator> idGeneratorList;
@Autowired
@Qualifier("configAccessProcessor")
private ConfigAccess configAccess;
@Override
public PageResult<List<RetryTaskResponseVO>> getRetryTaskPage(RetryTaskQueryVO queryVO) {
@ -143,7 +153,7 @@ public class RetryTaskServiceImpl implements RetryTaskService {
retryTask.setNextTriggerAt(
WaitStrategies.randomWait(1, TimeUnit.SECONDS, 60, TimeUnit.SECONDS).computeRetryTime(null));
retryTask.setUniqueId(getIdGenerator(retryTask.getGroupName()));
RequestDataHelper.setPartition(retryTaskRequestVO.getGroupName());
return retryTaskMapper.insert(retryTask);
}
@ -191,4 +201,22 @@ public class RetryTaskServiceImpl implements RetryTaskService {
RequestDataHelper.setPartition(requestVO.getGroupName());
return retryTaskMapper.deleteBatchIds(requestVO.getIds());
}
/**
* 获取分布式id
*
* @param groupName 组id
* @return 分布式id
*/
private String getIdGenerator(String groupName) {
GroupConfig groupConfig = configAccess.getGroupConfigByGroupName(groupName);
for (final IdGenerator idGenerator : idGeneratorList) {
if (idGenerator.supports(groupConfig.getIdGeneratorMode())) {
return idGenerator.idGenerator(groupName);
}
}
throw new EasyRetryServerException("id generator mode not configured. [{}]", groupName);
}
}

View File

@ -1 +1 @@
<!DOCTYPE html><html lang="zh-cmn-Hans"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/logo.png"><title>Easy-Retry</title><style>.first-loading-wrp{display:flex;justify-content:center;align-items:center;flex-direction:column;min-height:420px;height:100%}.first-loading-wrp>h1{font-size:128px}.first-loading-wrp .loading-wrp{padding:98px;display:flex;justify-content:center;align-items:center}.dot{animation:antRotate 1.2s infinite linear;transform:rotate(45deg);position:relative;display:inline-block;font-size:32px;width:32px;height:32px;box-sizing:border-box}.dot i{width:14px;height:14px;position:absolute;display:block;background-color:#1890ff;border-radius:100%;transform:scale(.75);transform-origin:50% 50%;opacity:.3;animation:antSpinMove 1s infinite linear alternate}.dot i:nth-child(1){top:0;left:0}.dot i:nth-child(2){top:0;right:0;-webkit-animation-delay:.4s;animation-delay:.4s}.dot i:nth-child(3){right:0;bottom:0;-webkit-animation-delay:.8s;animation-delay:.8s}.dot i:nth-child(4){bottom:0;left:0;-webkit-animation-delay:1.2s;animation-delay:1.2s}@keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@-webkit-keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@keyframes antSpinMove{to{opacity:1}}@-webkit-keyframes antSpinMove{to{opacity:1}}</style><link href="/css/chunk-65674ed1.5c85f85e.css" rel="prefetch"><link href="/css/chunk-77aaac2a.99cbbcce.css" rel="prefetch"><link href="/css/chunk-ff9025ec.cd4961ff.css" rel="prefetch"><link href="/css/user.6ccd4506.css" rel="prefetch"><link href="/js/chunk-2d0a4079.a823167e.js" rel="prefetch"><link href="/js/chunk-2d0b7230.62fc99c5.js" rel="prefetch"><link href="/js/chunk-2d0c8f97.29197140.js" rel="prefetch"><link href="/js/chunk-2d0d43f4.6f96f8f2.js" rel="prefetch"><link href="/js/chunk-2d0f085f.26f156d5.js" rel="prefetch"><link href="/js/chunk-2d21a08f.c6e37cf6.js" rel="prefetch"><link href="/js/chunk-2d228eef.110c5286.js" rel="prefetch"><link href="/js/chunk-40597980.4032d152.js" rel="prefetch"><link href="/js/chunk-65674ed1.a693ef6f.js" rel="prefetch"><link href="/js/chunk-732da7b5.a148b331.js" rel="prefetch"><link href="/js/chunk-77aaac2a.2f3b03ae.js" rel="prefetch"><link href="/js/chunk-ff9025ec.ca0600f2.js" rel="prefetch"><link href="/js/fail.9fe6fd49.js" rel="prefetch"><link href="/js/lang-zh-CN-account-settings.f8f25eaf.js" rel="prefetch"><link href="/js/lang-zh-CN-account.f7a734c3.js" rel="prefetch"><link href="/js/lang-zh-CN-dashboard-analysis.d7cabd65.js" rel="prefetch"><link href="/js/lang-zh-CN-dashboard.ffd6ecbd.js" rel="prefetch"><link href="/js/lang-zh-CN-form-basicForm.ff3088ac.js" rel="prefetch"><link href="/js/lang-zh-CN-form.39cd9999.js" rel="prefetch"><link href="/js/lang-zh-CN-global.bf0df5c8.js" rel="prefetch"><link href="/js/lang-zh-CN-menu.25425a62.js" rel="prefetch"><link href="/js/lang-zh-CN-result-fail.232762aa.js" rel="prefetch"><link href="/js/lang-zh-CN-result-success.3519c60c.js" rel="prefetch"><link href="/js/lang-zh-CN-result.b3df3bc6.js" rel="prefetch"><link href="/js/lang-zh-CN-setting.8c2ce690.js" rel="prefetch"><link href="/js/lang-zh-CN-user.81513cba.js" rel="prefetch"><link href="/js/lang-zh-CN.6ae67127.js" rel="prefetch"><link href="/js/user.ee9104e4.js" rel="prefetch"><link href="/css/app.37a20ada.css" rel="preload" as="style"><link href="/css/chunk-vendors.5be6e05a.css" rel="preload" as="style"><link href="/js/app.676f0bbc.js" rel="preload" as="script"><link href="/js/chunk-vendors.b8c3b6d4.js" rel="preload" as="script"><link href="/css/chunk-vendors.5be6e05a.css" rel="stylesheet"><link href="/css/app.37a20ada.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but vue-antd-pro doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"><div class="first-loading-wrp"><h2>Easy-Retry</h2><div class="loading-wrp"><span class="dot dot-spin"><i></i><i></i><i></i><i></i></span></div><div style="display: flex; justify-content: center; align-items: center;">分布式重试服务平台</div></div></div><script src="//cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.min.js"></script><script src="//cdn.jsdelivr.net/npm/vue-router@3.5.1/dist/vue-router.min.js"></script><script src="//cdn.jsdelivr.net/npm/vuex@3.1.1/dist/vuex.min.js"></script><script src="//cdn.jsdelivr.net/npm/axios@0.21.1/dist/axios.min.js"></script><script src="/js/chunk-vendors.b8c3b6d4.js"></script><script src="/js/app.676f0bbc.js"></script></body></html>
<!DOCTYPE html><html lang="zh-cmn-Hans"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/logo.png"><title>Easy-Retry</title><style>.first-loading-wrp{display:flex;justify-content:center;align-items:center;flex-direction:column;min-height:420px;height:100%}.first-loading-wrp>h1{font-size:128px}.first-loading-wrp .loading-wrp{padding:98px;display:flex;justify-content:center;align-items:center}.dot{animation:antRotate 1.2s infinite linear;transform:rotate(45deg);position:relative;display:inline-block;font-size:32px;width:32px;height:32px;box-sizing:border-box}.dot i{width:14px;height:14px;position:absolute;display:block;background-color:#1890ff;border-radius:100%;transform:scale(.75);transform-origin:50% 50%;opacity:.3;animation:antSpinMove 1s infinite linear alternate}.dot i:nth-child(1){top:0;left:0}.dot i:nth-child(2){top:0;right:0;-webkit-animation-delay:.4s;animation-delay:.4s}.dot i:nth-child(3){right:0;bottom:0;-webkit-animation-delay:.8s;animation-delay:.8s}.dot i:nth-child(4){bottom:0;left:0;-webkit-animation-delay:1.2s;animation-delay:1.2s}@keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@-webkit-keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@keyframes antSpinMove{to{opacity:1}}@-webkit-keyframes antSpinMove{to{opacity:1}}</style><link href="/css/chunk-65674ed1.5c85f85e.css" rel="prefetch"><link href="/css/chunk-77aaac2a.99cbbcce.css" rel="prefetch"><link href="/css/chunk-ff9025ec.cd4961ff.css" rel="prefetch"><link href="/css/user.6ccd4506.css" rel="prefetch"><link href="/js/chunk-2d0a4079.ce234129.js" rel="prefetch"><link href="/js/chunk-2d0b7230.c99b0e89.js" rel="prefetch"><link href="/js/chunk-2d0c8f97.862eacaa.js" rel="prefetch"><link href="/js/chunk-2d0d43f4.aa97adff.js" rel="prefetch"><link href="/js/chunk-2d0f085f.a697d9d6.js" rel="prefetch"><link href="/js/chunk-2d21a08f.8d8c6dd4.js" rel="prefetch"><link href="/js/chunk-2d228eef.54d493aa.js" rel="prefetch"><link href="/js/chunk-40597980.1b5283d9.js" rel="prefetch"><link href="/js/chunk-65674ed1.565bc7a2.js" rel="prefetch"><link href="/js/chunk-732da7b5.2c7af791.js" rel="prefetch"><link href="/js/chunk-77aaac2a.f00e709b.js" rel="prefetch"><link href="/js/chunk-ff9025ec.f20e5d3c.js" rel="prefetch"><link href="/js/fail.e8678bb3.js" rel="prefetch"><link href="/js/lang-zh-CN-account-settings.f8f25eaf.js" rel="prefetch"><link href="/js/lang-zh-CN-account.f7a734c3.js" rel="prefetch"><link href="/js/lang-zh-CN-dashboard-analysis.d7cabd65.js" rel="prefetch"><link href="/js/lang-zh-CN-dashboard.ffd6ecbd.js" rel="prefetch"><link href="/js/lang-zh-CN-form-basicForm.ff3088ac.js" rel="prefetch"><link href="/js/lang-zh-CN-form.39cd9999.js" rel="prefetch"><link href="/js/lang-zh-CN-global.bf0df5c8.js" rel="prefetch"><link href="/js/lang-zh-CN-menu.25425a62.js" rel="prefetch"><link href="/js/lang-zh-CN-result-fail.232762aa.js" rel="prefetch"><link href="/js/lang-zh-CN-result-success.3519c60c.js" rel="prefetch"><link href="/js/lang-zh-CN-result.b3df3bc6.js" rel="prefetch"><link href="/js/lang-zh-CN-setting.8c2ce690.js" rel="prefetch"><link href="/js/lang-zh-CN-user.81513cba.js" rel="prefetch"><link href="/js/lang-zh-CN.6ae67127.js" rel="prefetch"><link href="/js/user.015dd5f6.js" rel="prefetch"><link href="/css/app.37a20ada.css" rel="preload" as="style"><link href="/css/chunk-vendors.5be6e05a.css" rel="preload" as="style"><link href="/js/app.27f57850.js" rel="preload" as="script"><link href="/js/chunk-vendors.b8c3b6d4.js" rel="preload" as="script"><link href="/css/chunk-vendors.5be6e05a.css" rel="stylesheet"><link href="/css/app.37a20ada.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but vue-antd-pro doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"><div class="first-loading-wrp"><h2>Easy-Retry</h2><div class="loading-wrp"><span class="dot dot-spin"><i></i><i></i><i></i><i></i></span></div><div style="display: flex; justify-content: center; align-items: center;">分布式重试服务平台</div></div></div><script src="//cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.min.js"></script><script src="//cdn.jsdelivr.net/npm/vue-router@3.5.1/dist/vue-router.min.js"></script><script src="//cdn.jsdelivr.net/npm/vuex@3.1.1/dist/vuex.min.js"></script><script src="//cdn.jsdelivr.net/npm/axios@0.21.1/dist/axios.min.js"></script><script src="/js/chunk-vendors.b8c3b6d4.js"></script><script src="/js/app.27f57850.js"></script></body></html>

View File

@ -1 +0,0 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0d43f4"],{"5fe2":function(t,e,r){"use strict";r.r(e);var a=function(){var t=this,e=t._self._c;return e("div",[e("page-header-wrapper",[e("a-card",{attrs:{bordered:!1}},[e("a-descriptions",{attrs:{title:""}},[e("a-descriptions-item",{attrs:{label:"组名称"}},[t._v(" "+t._s(t.retryInfo.groupName)+" ")]),e("a-descriptions-item",{attrs:{label:"场景名称"}},[t._v(" "+t._s(t.retryInfo.sceneName)+" ")]),e("a-descriptions-item",{attrs:{label:"业务id",span:"2"}},[t._v(" "+t._s(t.retryInfo.idempotentId)+" ")]),e("a-descriptions-item",{attrs:{label:"业务编号"}},[t._v(" "+t._s(t.retryInfo.bizNo)+" ")]),e("a-descriptions-item",{attrs:{label:"下次触发时间"}},[t._v(" "+t._s(t.parseDate(t.retryInfo.nextTriggerAt))+" ")]),e("a-descriptions-item",{attrs:{label:"重试状态"}},[t._v(" "+t._s(t.retryStatus[t.retryInfo.retryStatus])+" ")]),e("a-descriptions-item",{attrs:{label:"创建时间"}},[t._v(" "+t._s(t.parseDate(t.retryInfo.createDt))+" ")]),e("a-descriptions-item",{attrs:{label:"执行器名称",span:"3"}},[t._v(" "+t._s(t.retryInfo.executorName)+" ")]),e("a-descriptions-item",{attrs:{label:"扩展参数",span:"3"}},[t._v(" "+t._s(t.retryInfo.bizNo)+" ")]),e("a-descriptions-item",{attrs:{label:"参数",span:"3"}},[t._v(" "+t._s(t.retryInfo.argsStr)+" ")]),e("a-descriptions-item",{attrs:{label:"失败原因",span:"3"}},[t._v(" "+t._s(t.retryInfo.errorMessage)+" ")])],1)],1)],1)],1)},s=[],n=r("0fea"),i=r("c1df"),o=r.n(i),c={name:"RetryLogInfo",data:function(){return{retryInfo:{},retryStatus:{0:"重试中",1:"重试完成",2:"最大次数"}}},created:function(){var t=this,e=this.$route.query.id;e&&Object(n["o"])(e).then((function(e){t.retryInfo=e.data}))},methods:{parseDate:function(t){return o()(t).format("YYYY-MM-DD HH:mm:ss")}}},d=c,p=r("2877"),l=Object(p["a"])(d,a,s,!1,null,"2efb2a61",null);e["default"]=l.exports}}]);

View File

@ -0,0 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0d43f4"],{"5fe2":function(t,e,r){"use strict";r.r(e);var a=function(){var t=this,e=t._self._c;return e("div",[e("page-header-wrapper",{staticStyle:{margin:"-24px -1px 0"},on:{back:function(){return t.$router.go(-1)}}},[e("div")]),e("a-card",{attrs:{bordered:!1}},[e("a-descriptions",{attrs:{title:"",bordered:""}},[e("a-descriptions-item",{attrs:{label:"组名称"}},[t._v(" "+t._s(t.retryInfo.groupName)+" ")]),e("a-descriptions-item",{attrs:{label:"场景名称"}},[t._v(" "+t._s(t.retryInfo.sceneName)+" ")]),e("a-descriptions-item",{attrs:{label:"唯一id"}},[t._v(" "+t._s(t.retryInfo.uniqueId)+" ")]),e("a-descriptions-item",{attrs:{label:"幂等id",span:2}},[t._v(" "+t._s(t.retryInfo.idempotentId)+" ")]),e("a-descriptions-item",{attrs:{label:"业务编号"}},[t._v(" "+t._s(t.retryInfo.bizNo)+" ")]),e("a-descriptions-item",{attrs:{label:"下次触发时间"}},[t._v(" "+t._s(t.parseDate(t.retryInfo.nextTriggerAt))+" ")]),e("a-descriptions-item",{attrs:{label:"执行时间"}},[t._v(" "+t._s(t.parseDate(t.retryInfo.createDt))+" ")]),e("a-descriptions-item",{attrs:{label:"当前重试状态"}},[t._v(" "+t._s(t.retryStatus[t.retryInfo.retryStatus])+" ")]),e("a-descriptions-item",{attrs:{label:"执行器名称",span:3}},[t._v(" "+t._s(t.retryInfo.executorName)+" ")]),e("a-descriptions-item",{attrs:{label:"参数",span:3}},[t._v(" "+t._s(t.retryInfo.argsStr)+" ")]),e("a-descriptions-item",{attrs:{label:"失败原因",span:3}},[t._v(" "+t._s(t.retryInfo.errorMessage)+" ")]),e("a-descriptions-item",{attrs:{label:"扩展参数",span:3}},[t._v(" "+t._s(t.retryInfo.extAttrs)+" ")])],1)],1)],1)},s=[],n=r("0fea"),i=r("c1df"),o=r.n(i),d={name:"RetryLogInfo",data:function(){return{retryInfo:{},retryStatus:{0:"重试中",1:"重试完成",2:"最大次数"}}},created:function(){var t=this,e=this.$route.query.id;e&&Object(n["o"])(e).then((function(e){t.retryInfo=e.data}))},methods:{parseDate:function(t){return o()(t).format("YYYY-MM-DD HH:mm:ss")}}},c=d,p=r("2877"),l=Object(p["a"])(c,a,s,!1,null,"517a0dc3",null);e["default"]=l.exports}}]);