Files
rocket-mq-springboot-starter/src/main/java/com/njcn/middle/rocket/domain/BaseMessage.java
2023-08-17 14:17:10 +08:00

37 lines
798 B
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.njcn.middle.rocket.domain;
import cn.hutool.core.util.IdUtil;
import lombok.Data;
import java.time.LocalDateTime;
/**
* @author hongawen
* @version 1.0.0
* @date 2023年08月04日 10:53
*/
@Data
public abstract class BaseMessage {
/**
* 业务键用于RocketMQ控制台查看消费情况
* 为了保证唯一性使用雪花算法生成一个随机id
*/
protected String key = IdUtil.getSnowflake().nextIdStr();
/**
* 发送消息来源,用于排查问题
*/
protected String source = "";
/**
* 发送时间
*/
protected LocalDateTime sendTime = LocalDateTime.now();
/**
* 重试次数,用于判断重试次数,超过重试次数发送异常警告
*/
protected Integer retryTimes = 0;
}