rocketmq-spring icon indicating copy to clipboard operation
rocketmq-spring copied to clipboard

使用 rocketmq proxy时, 客户端依旧与 docket 容器中的 broker 直接建立连接

Open idealzouhu opened this issue 1 year ago • 5 comments

客户端配置如下: rocketmq: name-server: localhost:8080 其中, name-server 的地址是 proxy 的地址。

报错信息为: `2024-09-19T17:00:00.640+08:00 ERROR 28360 --- [spring-boot-rocketmq-starter] [nio-9001-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: org.springframework.messaging.MessagingException: Send [3] times, still failed, cost [9004]ms, Topic: test-topic-1, BrokersSent: [15cc0e42b818, 15cc0e42b818, 15cc0e42b818] See https://rocketmq.apache.org/docs/bestPractice/06FAQ for further details.] with root cause

org.apache.rocketmq.remoting.exception.RemotingConnectException: connect to 172.18.0.4:8080 failed`

idealzouhu avatar Sep 19 '24 09:09 idealzouhu

same problem, but RocketMQ suggests use SDK based on gRPC when RocketMQ version is greater than 5.0

Vicent-Y avatar Oct 17 '24 03:10 Vicent-Y

这个问题还没解决吗。。。。查了两天,被搞死了

feiyusheng avatar Mar 19 '25 10:03 feiyusheng

问题在于本地无法访问容器ip,使用 docker run --network=host xxxx 运行试试

francisoliverlee avatar Mar 20 '25 02:03 francisoliverlee

namesrv,brokerIP1、brokerIP2配置为docker的host主机ip

francisoliverlee avatar Apr 10 '25 01:04 francisoliverlee

  - BROKER_NAME=broker-a
  - BROKER_IP1=192.168.xx.xx 改为宿主机ip依然无效

broker启动日志 The broker[c5e584af4df2, 172.18.0.10:10911] boot success. serializeType=JSON and name server is rmqnamesrv:9876

只有挂载配置文件才能解决

NoBugBoy avatar Aug 20 '25 06:08 NoBugBoy