程序包 com.walker.queue
类 MqBaseMessage
java.lang.Object
com.walker.queue.MqBaseMessage
消息实体,所有队列消息都需要继承此类。
- 作者:
- 时克英
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明getKey()业务键,用于RocketMQ控制台查看消费情况int重试次数。long发送时间,格式:20230919155102发送消息来源,用于排查问题getTopic()返回消息主题,由发送方提供。voidvoidsetRetryTimes(int retryTimes) voidsetSendTime(long sendTime) voidvoidtoString()
-
字段详细资料
-
topic
-
key
业务键,用于RocketMQ控制台查看消费情况 -
source
发送消息来源,用于排查问题 -
sendTime
protected long sendTime发送时间 -
retryTimes
protected int retryTimes重试次数,用于判断重试次数,超过重试次数发送异常警告
-
-
构造器详细资料
-
MqBaseMessage
public MqBaseMessage()
-
-
方法详细资料
-
getKey
业务键,用于RocketMQ控制台查看消费情况- 返回:
-
setKey
-
getSource
发送消息来源,用于排查问题- 返回:
-
setSource
-
getSendTime
public long getSendTime()发送时间,格式:20230919155102- 返回:
-
setSendTime
public void setSendTime(long sendTime) -
getRetryTimes
public int getRetryTimes()重试次数。- 返回:
-
setRetryTimes
public void setRetryTimes(int retryTimes) -
getTopic
返回消息主题,由发送方提供。- 返回:
-
setTopic
-
toString
-