witt-bit opened a new issue, #8195: URL: https://github.com/apache/rocketmq/issues/8195
### Before Creating the Bug Report - [X] I found a bug, not just asking a question, which should be created in [GitHub Discussions](https://github.com/apache/rocketmq/discussions). - [X] I have searched the [GitHub Issues](https://github.com/apache/rocketmq/issues) and [GitHub Discussions](https://github.com/apache/rocketmq/discussions) of this repository and believe that this is not a duplicate. - [X] I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ. ### Runtime platform environment Ubuntu 20.04.6 ### RocketMQ version 5.1.3 ### JDK Version open jdk 1.8.0_372 ### Describe the Bug 我项目所在的环境,网络是隔离的,有三台机器 1.A机器部署java客户端程序,在公网环境下。 2.B机器部署RocketMq Server与C在同一网络环境下,与A通过公网互通,与C通过内网互通。 3.C机器部署Java客户端程序,部署在内网环境,不能访问公网,且与A不互通。 我在B机器上启动RocketMq的Server时,配置了conf文件中`brokcerIP1`的值为`rocketmq-001`,这是一个`/etc/hosts`的hosts配置,我们期望RocketMQ Server在与客户端的通信中使用`hosts`作为地址,在A机器山嗯,会被`/etc/hosts`映射为公网地址与其通信,在C机器上,映射为内网地址与其通信 以上策略在4.X的服务端和客户端中,都是可以正常使用的,但在5.X上,RocketMQ Server在返回时,被替换为了本机的host地址,导致A和C机器不能与Server通信 ### Steps to Reproduce 配置`brokcerIP1`为一个hosts地址 ### What Did You Expect to See? 在5.x客户端,RocketMQ将brokcerIP1交给客户端来解析 ### What Did You See Instead? ```java 2024-05-24 15:45:53.185 ERROR [rm_PRODUCTION_5] [N/A] RocketmqClient#error:190 : sendMessageBack Exception, XXX org.apache.rocketmq.remoting.exception.RemotingConnectException: connect to 10.6.69.195:10911 failed at org.apache.rocketmq.remoting.netty.NettyRemotingClient.invokeSync(NettyRemotingClient.java:473) at org.apache.rocketmq.client.impl.MQClientAPIImpl.consumerSendMessageBack(MQClientAPIImpl.java:1470) at org.apache.rocketmq.client.impl.consumer.DefaultMQPushConsumerImpl.sendMessageBack(DefaultMQPushConsumerImpl.java:735) at org.apache.rocketmq.client.impl.consumer.DefaultMQPushConsumerImpl.sendMessageBack(DefaultMQPushConsumerImpl.java:722) at org.apache.rocketmq.client.impl.consumer.ConsumeMessageConcurrentlyService.sendMessageBack(ConsumeMessageConcurrentlyService.java:320) at org.apache.rocketmq.client.impl.consumer.ConsumeMessageConcurrentlyService.processConsumeResult(ConsumeMessageConcurrentlyService.java:287) at org.apache.rocketmq.client.impl.consumer.ConsumeMessageConcurrentlyService$ConsumeRequest.run(ConsumeMessageConcurrentlyService.java:455) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ``` `10.6.69.195`是Server的本机地址 ### Additional Context _No response_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
