Skip to content

Commit d0ea857

Browse files
committed
feat: 对 TxMsg retry 和 auto clear 实现提供 xxl-job 支持
1 parent 94b4efc commit d0ea857

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

framework/framework_base/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@
5959
<groupId>com.github.cadecode</groupId>
6060
<artifactId>uni-boot-common-plugin-storage</artifactId>
6161
</dependency>
62+
<dependency>
63+
<groupId>com.github.cadecode</groupId>
64+
<artifactId>uni-boot-common-plugin-job</artifactId>
65+
</dependency>
6266
<dependency>
6367
<groupId>com.github.cadecode</groupId>
6468
<artifactId>uni-boot-framework-api</artifactId>

framework/framework_base/src/main/java/com/github/cadecode/uniboot/framework/base/plugin/handler/MqTxMsgHandler.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import com.github.cadecode.uniboot.framework.base.plugin.convert.PlgMqMsgConvert;
2121
import com.github.cadecode.uniboot.framework.base.plugin.enums.SendStateEnum;
2222
import com.github.cadecode.uniboot.framework.base.plugin.service.PlgMqMsgService;
23+
import com.xxl.job.core.handler.annotation.XxlJob;
2324
import lombok.RequiredArgsConstructor;
2425
import lombok.extern.slf4j.Slf4j;
2526
import org.springframework.amqp.core.Message;
@@ -64,6 +65,7 @@ public class MqTxMsgHandler extends AbstractTxMsgHandler {
6465

6566
private final PlgMqMsgService mqMsgService;
6667

68+
@XxlJob("MqTxMsgRetry")
6769
@Override
6870
public void doRetry() {
6971
String lockKey = KeyGeneUtil.lockKey(LOCK_TX_MSG_DO_RETRY);
@@ -110,6 +112,7 @@ private boolean updateRetryTime(String txMsgId, int newLeftRetryTimes, Date newN
110112
.update(new PlgMqMsg());
111113
}
112114

115+
@XxlJob("MqTxMsgAutoClear")
113116
@Override
114117
public void doClear(Long autoClearInterval) {
115118
String lockKey = KeyGeneUtil.lockKey(LOCK_TX_MSG_DO_CLEAR);

0 commit comments

Comments
 (0)