使用 rocketmq proxy时, 客户端依旧与 docket 容器中的 broker 直接建立连接
客户端配置如下:
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`
same problem, but RocketMQ suggests use SDK based on gRPC when RocketMQ version is greater than 5.0
这个问题还没解决吗。。。。查了两天,被搞死了
问题在于本地无法访问容器ip,使用 docker run --network=host xxxx 运行试试
namesrv,brokerIP1、brokerIP2配置为docker的host主机ip
- 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
只有挂载配置文件才能解决