|
|
@ -1,9 +1,12 @@ |
|
|
package com.bnyer.img.listener; |
|
|
package com.bnyer.img.listener; |
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.IdUtil; |
|
|
import com.alibaba.fastjson.JSON; |
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
|
|
import com.bnyer.common.core.constant.ServiceNameConstants; |
|
|
import com.bnyer.common.core.dto.AddUserVipRecordDto; |
|
|
import com.bnyer.common.core.dto.AddUserVipRecordDto; |
|
|
import com.bnyer.common.core.enums.EnumMessageStatus; |
|
|
import com.bnyer.common.core.enums.EnumMessageStatus; |
|
|
import com.bnyer.common.core.utils.bean.EntityConvertUtil; |
|
|
import com.bnyer.common.core.utils.bean.EntityConvertUtil; |
|
|
|
|
|
import com.bnyer.common.core.utils.uuid.IdUtils; |
|
|
import com.bnyer.common.rocketmq.constant.RocketMqTopic; |
|
|
import com.bnyer.common.rocketmq.constant.RocketMqTopic; |
|
|
import com.bnyer.common.rocketmq.domain.img.AddUserVipRecordMessage; |
|
|
import com.bnyer.common.rocketmq.domain.img.AddUserVipRecordMessage; |
|
|
import com.bnyer.common.rocketmq.domain.order.OrderMqLocalRecordMessage; |
|
|
import com.bnyer.common.rocketmq.domain.order.OrderMqLocalRecordMessage; |
|
|
@ -49,7 +52,7 @@ public class VipRecordCreateConsumer extends EnhanceMessageHandler<OrderMqLocalR |
|
|
//发送返回队列,告知已经处理成功,完成最终一致性
|
|
|
//发送返回队列,告知已经处理成功,完成最终一致性
|
|
|
//TODO: 2023/05/20 为避免这里消息通知失败,定时补偿的时候需要根据创建时间,判断如果超过固定时间比如30分钟,就直接设置成作废,避免
|
|
|
//TODO: 2023/05/20 为避免这里消息通知失败,定时补偿的时候需要根据创建时间,判断如果超过固定时间比如30分钟,就直接设置成作废,避免
|
|
|
// 定时任务一直补偿,因为这里不做补偿机制,是不会重发消息的
|
|
|
// 定时任务一直补偿,因为这里不做补偿机制,是不会重发消息的
|
|
|
message.setStatus(EnumMessageStatus.SUCCESS); |
|
|
super.buildRerunMessage(EnumMessageStatus.SUCCESS, message); |
|
|
rocketMQEnhanceTemplate.sendAsyncMsg(RocketMqTopic.ORDER_RETURN_MSG_TOPIC,null,message); |
|
|
rocketMQEnhanceTemplate.sendAsyncMsg(RocketMqTopic.ORDER_RETURN_MSG_TOPIC,null,message); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -58,7 +61,7 @@ public class VipRecordCreateConsumer extends EnhanceMessageHandler<OrderMqLocalR |
|
|
//发送返回队列,告知已经超过最大重试次数,消费失败,需人工处理该记录
|
|
|
//发送返回队列,告知已经超过最大重试次数,消费失败,需人工处理该记录
|
|
|
//TODO: 2023/05/20 为避免这里消息通知失败,定时补偿的时候需要根据创建时间,判断如果超过固定时间比如30分钟,就直接设置成作废,避免
|
|
|
//TODO: 2023/05/20 为避免这里消息通知失败,定时补偿的时候需要根据创建时间,判断如果超过固定时间比如30分钟,就直接设置成作废,避免
|
|
|
// 定时任务一直补偿,因为这里不做补偿机制,是不会重发消息的
|
|
|
// 定时任务一直补偿,因为这里不做补偿机制,是不会重发消息的
|
|
|
message.setStatus(EnumMessageStatus.FAILS); |
|
|
super.buildRerunMessage(EnumMessageStatus.FAILS, message); |
|
|
rocketMQEnhanceTemplate.sendAsyncMsg(RocketMqTopic.ORDER_RETURN_MSG_TOPIC,null,message); |
|
|
rocketMQEnhanceTemplate.sendAsyncMsg(RocketMqTopic.ORDER_RETURN_MSG_TOPIC,null,message); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|