update 设置ttl超时时间

This commit is contained in:
yyb
2026-01-29 12:03:51 +08:00
parent 91b39daba3
commit f73ceb9e23
2 changed files with 10 additions and 4 deletions

View File

@@ -726,8 +726,11 @@ public class LeaseShopServiceImpl extends ServiceImpl<LeaseShopMapper, LeaseShop
.user_email(username+"--"+authId)
.build();
try {
//发送提现消息
rabbitTemplate.convertAndSend(PAY_WITHDRAW_QUEUE,message);
//发送提现消息,设置 8 分钟 TTL
rabbitTemplate.convertAndSend(PAY_WITHDRAW_QUEUE, message, msg -> {
msg.getMessageProperties().setExpiration(String.valueOf(480 * 1000));
return msg;
});
OperationLogAspect.addExtraLogParam("提现金额", balanceVo.getAmount());
OperationLogAspect.addExtraLogParam("手续费", serviceCharge.toString());
OperationLogAspect.addExtraLogParam("消息ID", queueId);

View File

@@ -1305,8 +1305,11 @@ public class LeaseUserServiceImpl extends ServiceImpl<LeaseUserMapper, LeaseUser
.build();
try {
//发送 提现 消息
rabbitTemplate.convertAndSend(PAY_WITHDRAW_QUEUE,message);
//发送 提现 消息,设置 8 分钟 TTL
rabbitTemplate.convertAndSend(PAY_WITHDRAW_QUEUE, message, msg -> {
msg.getMessageProperties().setExpiration(String.valueOf(480 *1000));
return msg;
});
OperationLogAspect.addExtraLogParam("提现金额", balanceVo.getAmount().toString());
OperationLogAspect.addExtraLogParam("手续费", serviceCharge.toString());
OperationLogAspect.addExtraLogParam("消息ID", queueId);