Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Send and Consume Messages in RocketMQ5.x Proxy Mode with Spring Boot3 and JDK 17 and Rocketmq starter #8088

Open
3 tasks done
radish172521 opened this issue May 2, 2024 · 1 comment

Comments

@radish172521
Copy link

Before Creating the Bug Report

  • I found a bug, not just asking a question, which should be created in GitHub Discussions.

  • I have searched the GitHub Issues and GitHub Discussions of this repository and believe that this is not a duplicate.

  • I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.

Runtime platform environment

windows, linux

RocketMQ version

version : 5.1.2

JDK Version

jdk17

Describe the Bug

I am currently working on a Spring Boot 3 and Rocketmq starter project with JDK 17 , and I want to use RocketMQ 5.x in Proxy mode. To achieve this, I added the following configuration to my project: META-INF\spring\org.springframework.boot.autoconfigure.AutoConfiguration.imports, with the content org.apache.rocketmq.spring.autoconfigure.RocketMQAutoConfiguration.

With the current configuration, setting rocketmq.name-server=xxx allows successful production and consumption of messages. However, when I switch to RocketMQ proxy mode by setting rocketmq.name-server=proxy remotingListenPort, the project starts normally but fails to send or consume messages.

Here’s the error message I encounter:
Caused by: org.apache.rocketmq.remoting.exception.RemotingSendRequestException: send request to </xxxx:xxx> failed at org.apache.rocketmq.remoting.netty.NettyRemotingAbstract.invokeSyncImpl(NettyRemotingAbstract.java:491) at org.apache.rocketmq.remoting.netty.NettyRemotingClient.invokeSync(NettyRemotingClient.java:551) at org.apache.rocketmq.client.impl.MQClientAPIImpl.getTopicRouteInfoFromNameServer(MQClientAPIImpl.java:1991) at org.apache.rocketmq.client.impl.MQClientAPIImpl.getTopicRouteInfoFromNameServer(MQClientAPIImpl.java:1982) at org.apache.rocketmq.client.impl.factory.MQClientInstance.updateTopicRouteInfoFromNameServer(MQClientInstance.java:781) ... 25 common frames omitted Caused by: org.apache.rocketmq.remoting.exception.RemotingSendRequestException: send request to </xxxx:xxx> failed at org.apache.rocketmq.remoting.netty.ResponseFuture.executeInvokeCallback(ResponseFuture.java:70) at org.apache.rocketmq.remoting.netty.NettyRemotingAbstract.lambda$executeInvokeCallback$2(NettyRemotingAbstract.java:402) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) at java.base/java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:264) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:842) 2024-05-02 18:30:24.363 [Thread-7] WARN com.alibaba.nacos.common.notify.NotifyCenter - [NotifyCenter] Start destroying Publisher 2024-05-02 18:30:24.363 [Thread-7] WARN com.alibaba.nacos.common.notify.NotifyCenter - [NotifyCenter] Destruction of the end 2024-05-02 18:30:24.363 [Thread-1] WARN c.alibaba.nacos.common.http.HttpClientBeanHolder - [HttpClientBeanHolder] Start destroying common HttpClient 2024-05-02 18:30:24.364 [Thread-1] WARN c.alibaba.nacos.common.http.HttpClientBeanHolder - [HttpClientBeanHolder] Destruction of the end

Steps to Reproduce

I am currently working on a Spring Boot 3 project with JDK 17, and I want to use RocketMQ 5.x in proxy mode. To achieve this, I added the following configuration to my project: META-INF\spring\org.springframework.boot.autoconfigure.AutoConfiguration.imports, with the content org.apache.rocketmq.spring.autoconfigure.RocketMQAutoConfiguration.

With the current configuration, setting rocketmq.name-server=xxx allows successful production and consumption of messages. However, when I switch to RocketMQ proxy mode by setting rocketmq.name-server=proxy remotingListenPort, the project starts normally but fails to send or consume messages.

Here’s the error message I encounter:
Caused by: org.apache.rocketmq.remoting.exception.RemotingSendRequestException: send request to </xxxx:xxx> failed at org.apache.rocketmq.remoting.netty.NettyRemotingAbstract.invokeSyncImpl(NettyRemotingAbstract.java:491) at org.apache.rocketmq.remoting.netty.NettyRemotingClient.invokeSync(NettyRemotingClient.java:551) at org.apache.rocketmq.client.impl.MQClientAPIImpl.getTopicRouteInfoFromNameServer(MQClientAPIImpl.java:1991) at org.apache.rocketmq.client.impl.MQClientAPIImpl.getTopicRouteInfoFromNameServer(MQClientAPIImpl.java:1982) at org.apache.rocketmq.client.impl.factory.MQClientInstance.updateTopicRouteInfoFromNameServer(MQClientInstance.java:781) ... 25 common frames omitted Caused by: org.apache.rocketmq.remoting.exception.RemotingSendRequestException: send request to </xxxx:xxx> failed at org.apache.rocketmq.remoting.netty.ResponseFuture.executeInvokeCallback(ResponseFuture.java:70) at org.apache.rocketmq.remoting.netty.NettyRemotingAbstract.lambda$executeInvokeCallback$2(NettyRemotingAbstract.java:402) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) at java.base/java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:264) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:842) 2024-05-02 18:30:24.363 [Thread-7] WARN com.alibaba.nacos.common.notify.NotifyCenter - [NotifyCenter] Start destroying Publisher 2024-05-02 18:30:24.363 [Thread-7] WARN com.alibaba.nacos.common.notify.NotifyCenter - [NotifyCenter] Destruction of the end 2024-05-02 18:30:24.363 [Thread-1] WARN c.alibaba.nacos.common.http.HttpClientBeanHolder - [HttpClientBeanHolder] Start destroying common HttpClient 2024-05-02 18:30:24.364 [Thread-1] WARN c.alibaba.nacos.common.http.HttpClientBeanHolder - [HttpClientBeanHolder] Destruction of the end

What Did You Expect to See?

Expect normal consumer/producer work successfully.

What Did You See Instead?

Caused by: org.apache.rocketmq.remoting.exception.RemotingSendRequestException: send request to </xxxx> failed at org.apache.rocketmq.remoting.netty.NettyRemotingAbstract.invokeSyncImpl(NettyRemotingAbstract.java:491) at org.apache.rocketmq.remoting.netty.NettyRemotingClient.invokeSync(NettyRemotingClient.java:551) at org.apache.rocketmq.client.impl.MQClientAPIImpl.getTopicRouteInfoFromNameServer(MQClientAPIImpl.java:1991) at org.apache.rocketmq.client.impl.MQClientAPIImpl.getTopicRouteInfoFromNameServer(MQClientAPIImpl.java:1982) at org.apache.rocketmq.client.impl.factory.MQClientInstance.updateTopicRouteInfoFromNameServer(MQClientInstance.java:781) ... 25 common frames omitted Caused by: org.apache.rocketmq.remoting.exception.RemotingSendRequestException: send request to </xxxxx> failed at org.apache.rocketmq.remoting.netty.ResponseFuture.executeInvokeCallback(ResponseFuture.java:70) at org.apache.rocketmq.remoting.netty.NettyRemotingAbstract.lambda$executeInvokeCallback$2(NettyRemotingAbstract.java:402) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) at java.base/java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:264) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:842) 2024-05-02 18:30:24.363 [Thread-7] WARN com.alibaba.nacos.common.notify.NotifyCenter - [NotifyCenter] Start destroying Publisher 2024-05-02 18:30:24.363 [Thread-7] WARN com.alibaba.nacos.common.notify.NotifyCenter - [NotifyCenter] Destruction of the end 2024-05-02 18:30:24.363 [Thread-1] WARN c.alibaba.nacos.common.http.HttpClientBeanHolder - [HttpClientBeanHolder] Start destroying common HttpClient 2024-05-02 18:30:24.364 [Thread-1] WARN c.alibaba.nacos.common.http.HttpClientBeanHolder - [HttpClientBeanHolder] Destruction of the end

Additional Context

I hope this compatibility issue is resolved , Or how to use proxy correctly?

@drpmma
Copy link
Contributor

drpmma commented May 7, 2024

It seems that the request is not sent to the proxy. Maybe you should debug the proxy and see whether the request reaches the proxy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants