修复pay-service中rocketMq实例无法注入
This commit is contained in:
@@ -85,7 +85,6 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.rocketmq</groupId>
|
||||
<artifactId>rocketmq-client</artifactId>
|
||||
<version>5.3.2</version> <!-- 这个存在于 Central -->
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
@@ -5,6 +5,7 @@ import cn.mayiming.Entity.PayRecord;
|
||||
import cn.mayiming.Entity.PayTriggerMsgDTO;
|
||||
import cn.mayiming.Mapper.payMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
# RocketMQ 2.2.3 version does not adapt to SpringBoot3
|
||||
org.apache.rocketmq.spring.autoconfigure.RocketMQAutoConfiguration
|
||||
@@ -41,6 +41,8 @@ spring:
|
||||
rocketmq:
|
||||
# NameServer 地址(替换为你的 RocketMQ 服务器IP)
|
||||
name-server: 127.0.0.1:9876
|
||||
producer:
|
||||
group: pay-producer-group
|
||||
consumer:
|
||||
# 消费者组名(必须唯一,建议按服务+用途命名)
|
||||
group: pay-service-consumer
|
||||
|
||||
27
pom.xml
27
pom.xml
@@ -18,6 +18,24 @@
|
||||
<version>3.2.3</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>apache-snapshots</id>
|
||||
<name>Apache Snapshots</name>
|
||||
<url>https://repository.apache.org/content/repositories/releases/</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
<!-- 保留中央仓库 -->
|
||||
<repository>
|
||||
<id>central</id>
|
||||
<url>https://repo.maven.apache.org/maven2</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<!-- 统一版本变量(新增 spring-boot.version 兜底) -->
|
||||
<properties>
|
||||
@@ -87,18 +105,13 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.rocketmq</groupId>
|
||||
<artifactId>rocketmq-client-java</artifactId>
|
||||
<artifactId>rocketmq-client</artifactId>
|
||||
<version>5.3.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.rocketmq</groupId>
|
||||
<artifactId>rocketmq-spring-boot-starter</artifactId>
|
||||
<version>2.3.2</version> <!-- 适配 RocketMQ 5.x,建议2.2.x+ -->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.rocketmq</groupId>
|
||||
<artifactId>rocketmq-client</artifactId>
|
||||
<version>5.3.2</version> <!-- 这个存在于 Central -->
|
||||
<version>2.3.4</version> <!-- 适配 RocketMQ 5.x,建议2.2.x+ -->
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
Reference in New Issue
Block a user