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

接入阿里云rocketMQ,本地发送消息失败,但是在阿里云控制台发送的消息可以消费! #470

Closed
fangqyou opened this issue Jul 21, 2022 · 4 comments

Comments

@fangqyou
Copy link

异常信息:
org.springframework.messaging.MessagingException: No route info of this topic: trace_17_track_notify
See http://rocketmq.apache.org/docs/faq/ for further details.; nested exception is org.apache.rocketmq.client.exception.MQClientException: No route info of this topic: trace_17_track_notify
See http://rocketmq.apache.org/docs/faq/ for further details.
at org.apache.rocketmq.spring.core.RocketMQTemplate.syncSend(RocketMQTemplate.java:566) ~[rocketmq-spring-boot-2.2.2.jar:2.2.2]
at org.apache.rocketmq.spring.core.RocketMQTemplate.syncSend(RocketMQTemplate.java:487) ~[rocketmq-spring-boot-2.2.2.jar:2.2.2]
at org.apache.rocketmq.spring.core.RocketMQTemplate.syncSend(RocketMQTemplate.java:475) ~[rocketmq-spring-boot-2.2.2.jar:2.2.2]
at org.apache.rocketmq.spring.core.RocketMQTemplate.doSend(RocketMQTemplate.java:977) ~[rocketmq-spring-boot-2.2.2.jar:2.2.2]
at org.apache.rocketmq.spring.core.RocketMQTemplate.doSend(RocketMQTemplate.java:60) ~[rocketmq-spring-boot-2.2.2.jar:2.2.2]
at org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:109) ~[spring-messaging-5.3.21.jar:5.3.21]
at com.example.springbootmqtest.SaticScheduleTask.configureTasks(SaticScheduleTask.java:23) ~[classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_252]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_252]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_252]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_252]
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84) ~[spring-context-5.3.21.jar:5.3.21]
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[spring-context-5.3.21.jar:5.3.21]
at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:95) [spring-context-5.3.21.jar:5.3.21]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_252]
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) [na:1.8.0_252]
at java.util.concurrent.FutureTask.run(FutureTask.java) [na:1.8.0_252]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_252]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_252]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_252]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_252]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_252]
Caused by: org.apache.rocketmq.client.exception.MQClientException: No route info of this topic: trace_17_track_notify
See http://rocketmq.apache.org/docs/faq/ for further details.
at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.sendDefaultImpl(DefaultMQProducerImpl.java:675) ~[rocketmq-client-4.9.3.jar:4.9.3]
at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.send(DefaultMQProducerImpl.java:1367) ~[rocketmq-client-4.9.3.jar:4.9.3]
at org.apache.rocketmq.client.producer.DefaultMQProducer.send(DefaultMQProducer.java:354) ~[rocketmq-client-4.9.3.jar:4.9.3]
at org.apache.rocketmq.spring.core.RocketMQTemplate.syncSend(RocketMQTemplate.java:558) ~[rocketmq-spring-boot-2.2.2.jar:2.2.2]
... 21 common frames omitted

配置:

image

发送代码:
@configuration
@EnableScheduling
public class SaticScheduleTask {

String topic = "trace_17_track_notify";

@Resource
private RocketMQTemplate rocketMQTemplate;

//3.添加定时任务
@Scheduled(cron = "0/10 * * * * ?")
private void configureTasks() {
    rocketMQTemplate.send(topic, MessageBuilder.withPayload("消息内容xxx").build());
}

}
消费代码:
@component
@RocketMQMessageListener(topic = "trace_17_track_notify", consumerGroup = "GID_TEST_GROUP")
public class TestListener implements RocketMQListener {
@OverRide
public void onMessage(MessageExt messageExt) {
String msgId = messageExt.getMsgId();
System.out.println(msgId);
}
}

阿里云工作台信息:

image

@RongtongJin
Copy link
Contributor

Hi @fangqyou, we don't deal with Alibaba cloud related problems. You can submit a work order to Alibaba cloud. You are welcome to report bugs or contribute features to rocketmq-spring.

@fangqyou
Copy link
Author

ok thanks

@YooLin
Copy link

YooLin commented Feb 28, 2023

2.2.2 版本是连不上 降到 2.2.1 版本就可以了 @fangqyou

@PudgeXD
Copy link

PudgeXD commented Nov 14, 2023

try to configure 'rocketmq.producer.namespace' to the instaceId of the instance in Alibaba clound. It works for me.

By checking the codes, 2.2.2 version add the feature of supporting namespace, while the codes did not care about the compatialbility.
As a result, since 2.2.2, we have to specify the namespace explicitly.

namespace related issues:
#396
#397

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

4 participants