程序包 com.walker.queue

类 MqBaseMessage

java.lang.Object
com.walker.queue.MqBaseMessage

public abstract class MqBaseMessage extends Object
消息实体,所有队列消息都需要继承此类。
作者:
时克英
  • 字段详细资料

    • topic

      protected String topic
    • key

      protected String key
      业务键,用于RocketMQ控制台查看消费情况
    • source

      protected String source
      发送消息来源,用于排查问题
    • sendTime

      protected long sendTime
      发送时间
    • retryTimes

      protected int retryTimes
      重试次数,用于判断重试次数,超过重试次数发送异常警告
  • 构造器详细资料

    • MqBaseMessage

      public MqBaseMessage()
  • 方法详细资料

    • getKey

      public String getKey()
      业务键,用于RocketMQ控制台查看消费情况
      返回:
    • setKey

      public void setKey(String key)
    • getSource

      public String getSource()
      发送消息来源,用于排查问题
      返回:
    • setSource

      public void setSource(String source)
    • getSendTime

      public long getSendTime()
      发送时间,格式:20230919155102
      返回:
    • setSendTime

      public void setSendTime(long sendTime)
    • getRetryTimes

      public int getRetryTimes()
      重试次数。
      返回:
    • setRetryTimes

      public void setRetryTimes(int retryTimes)
    • getTopic

      public String getTopic()
      返回消息主题,由发送方提供。
      返回:
    • setTopic

      public void setTopic(String topic)
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object