Explain to the background:
RocketMQ ECS server set up in the above (problem lies here)
The application of the official website SpringBoot Construction Demo (Reference: //github.com/apache/rocketmq-spring/tree/master/rocketmq-spring-boot-samples: https)
The project started when he started to print the remote address is empty, sending the message fails and also print remote address is empty:
RocketmqRemoting: closeChannel: close the connection to remote address[] result: true
remote address is empty, I began to think that the project rocketmq.name-server configuration problem, no problem by obtaining RocketMQTemplate of namesrvAddr found the following code
rocketMQTemplate.getProducer().getNamesrvAddr()
Look again Throwable SendCallback, the following error message:
org.apache.rocketmq.client.exception.MQClientException: Send [1] times, still failed, cost [5325]ms, Topic: ADDRESS_PART_TOPIC, BrokersSent: [broker-a] See http://rocketmq.apache.org/docs/faq/ for further details. at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.sendDefaultImpl(DefaultMQProducerImpl.java:638) at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.access$300(DefaultMQProducerImpl.java:90) at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl$3.run(DefaultMQProducerImpl.java:491) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) at java.util.concurrent.FutureTask.run(FutureTask.java) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: org.apache.rocketmq.remoting.exception.RemotingConnectException: connect to <192.168.0.4:10911> failed at org.apache.rocketmq.remoting.netty.NettyRemotingClient.invokeAsync(NettyRemotingClient.java:537) at org.apache.rocketmq.client.impl.MQClientAPIImpl.sendMessageAsync(MQClientAPIImpl.java:484) at org.apache.rocketmq.client.impl.MQClientAPIImpl.sendMessage(MQClientAPIImpl.java:441) at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.sendKernelImpl(DefaultMQProducerImpl.java:811) at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.sendDefaultImpl(DefaultMQProducerImpl.java:557) ... 8 more
See 192.168.0.4:10911 address this problem is to know Broker service in the RocketMQ, 192.168.0.4 IP address is within the ECS
Here's look at the startup information Broker:
The broker[broker-a, 192.168.0.4:10911] boot success. serializeType=JSON and name server is X.X.X.X:9876
The problem is brokerIP determine the server's internal network IP lead producer can not establish a connection lead
Solution:
// Check broker configuration sh ./bin/mqbroker -m
Increase in conf / broker.conf profile
brokerIP1 = XXXX (public IP)
Start broker service again
nohup sh bin/mqbroker -n 111.231.XX.XX:9876 -c conf/broker.conf autoCreateTopicEnable=true &
Start Results:
The broker[broker-a, X.X.X.X:10911] boot success. serializeType=JSON and name server is 106.12.5.49:9876
Restart the local project, testing producer to send messages successfully