切换位置BaseMessage
This commit is contained in:
9
pom.xml
9
pom.xml
@@ -12,12 +12,12 @@
|
||||
<repository>
|
||||
<id>nexus-releases</id>
|
||||
<name>Nexus Release Repository</name>
|
||||
<url>http://192.168.1.13:8001/nexus/content/repositories/releases/</url>
|
||||
<url>http://192.168.1.22:8001/nexus/content/repositories/releases/</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>nexus-snapshots</id>
|
||||
<name>Nexus Snapshot Repository</name>
|
||||
<url>http://192.168.1.13:8001/nexus/content/repositories/snapshots/</url>
|
||||
<url>http://192.168.1.22:8001/nexus/content/repositories/snapshots/</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
|
||||
@@ -43,6 +43,11 @@
|
||||
<artifactId>rocketmq-spring-boot-starter</artifactId>
|
||||
<version>2.2.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn.platform</groupId>
|
||||
<artifactId>message-api</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<!--避免idea后端配置类报红-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user