rocketmq依赖怎么设置?

来源:9-9 Spring消息编程模型01-编写生产者

hthonor

2020-10-19

spring cloud 版本 Hoxton.SR3

spring cloud alibaba  版本2.2.1.RELEASE


大目老师,我的项目 rocketmq 的依赖是这样的

<dependency>
  <groupId>com.alibaba.cloud</groupId>
  <artifactId>spring-cloud-starter-stream-rocketmq</artifactId>
</dependency>

http://img1.sycdn.imooc.com/szimg/5f8da8d809e06c8a10360476.jpg

rocketmq-client 的版本却是4.4.0

但是我使用的 rocketmq 以及控制台的版本都是4.7.1

我应该怎样设置依赖?




写回答

2回答

hthonor

提问者

2020-10-20

连接问题已解决。

我的依赖是这样的,不知道对不对?

<!--rocketmq-->
<dependency>
  <groupId>com.alibaba.cloud</groupId>
  <artifactId>spring-cloud-starter-stream-rocketmq</artifactId>
</dependency>
<dependency>
  <groupId>org.apache.rocketmq</groupId>
  <artifactId>rocketmq-client</artifactId>
  <version>4.7.1</version>
</dependency>

0
0

hthonor

提问者

2020-10-19

rocketmq 控制台 :我只修改了端口号

//img.mukewang.com/szimg/5f8db12109f2e36213140396.jpg

//img.mukewang.com/szimg/5f8db15a097d330908440276.jpg


控制台报错

[2020-10-19 23:33:30.009]  INFO closeChannel: close the connection to remote address[] result: true

[2020-10-19 23:33:30.011] ERROR Unexpected error occurred in scheduled task

java.lang.RuntimeException: org.apache.rocketmq.remoting.exception.RemotingConnectException: connect to [rocketmq.config.namesrvAddr=localhost:9876] failed


//img1.sycdn.imooc.com/szimg/5f8db18c091f805e17640988.jpg







0
1
大目
请问和 http://coding.imooc.com/learn/questiondetail/208923.html 这个是一个问题吗?
2020-10-20
共1条回复

Spring Cloud Alibaba微服务从入门到进阶

面向未来微服务:熟练掌握Spring Cloud Alibaba

3085 学习 · 1324 问题

查看课程