问题描述
当我们搭建好 RocketMQ 的dashboard后,我们点击状态会报下述图片右上方的错。
后台报错
org.apache.rocketmq.client.exception.MQBrokerException: CODE: 3 DESC: request type 351 not supported
Caused by: org.apache.rocketmq.client.exception.MQBrokerException: CODE: 3 DESC: request type 351 not supported
For more information, please visit the url, https://rocketmq.apache.org/docs/bestPractice/06FAQ
at org.apache.rocketmq.client.impl.MQClientAPIImpl.getTopicConfig(MQClientAPIImpl.java:2872)
at org.apache.rocketmq.tools.admin.DefaultMQAdminExtImpl.examineTopicConfig(DefaultMQAdminExtImpl.java:326)
at org.apache.rocketmq.tools.admin.DefaultMQAdminExt.examineTopicConfig(DefaultMQAdminExt.java:245)
at org.apache.rocketmq.tools.admin.MQAdminUtils.examineTopicConfigFromRoute(MQAdminUtils.java:249)
at org.apache.rocketmq.tools.admin.DefaultMQAdminExtImpl.examineTopicStats(DefaultMQAdminExtImpl.java:344)
at org.apache.rocketmq.tools.admin.DefaultMQAdminExt.examineTopicStats(DefaultMQAdminExt.java:252)
at org.apache.rocketmq.dashboard.service.client.MQAdminExtImpl.examineTopicStats(MQAdminExtImpl.java:190)
at org.apache.rocketmq.dashboard.service.client.MQAdminExtImpl$$FastClassBySpringCGLIB$$a15c4ca6.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:783)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89)
at org.apache.rocketmq.dashboard.aspect.admin.MQAdminAspect.aroundMQAdminMethod(MQAdminAspect.java:52)
at jdk.internal.reflect.GeneratedMethodAccessor89.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:634)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:624)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:72)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:698)
at org.apache.rocketmq.dashboard.service.client.MQAdminExtImpl$$EnhancerBySpringCGLIB$$68cce099.examineTopicStats(<generated>)
at org.apache.rocketmq.dashboard.service.impl.TopicServiceImpl.stats(TopicServiceImpl.java:95)
... 78 common frames omitted
解决办法
是因为 RokcetMQ 的版本 和 RocketMQ Dashboard 版本不一致导致的。
我们在 pom.xml 文件中查看 RocketMQ 的版本。
- 如果当前 RocketMQ 的版本小于 5.0,但是 pom.xml 文件中的 RocketMQ 版本 大于 5.0,那么这时候就去官网 重新下载 RocketMQ Dashboard 版本
- 如果当前 RocketMQ 的版本大于 5.0,但是 pom.xml 文件中的 RocketMQ 版本 小于 5.0,那么这时候就去 Github 重新下载 RocketMQ Dashboard 版本
注意
如果我们使用的是 RocketMQ 5.0 以下的版本,那么在 搭建 Dashboard 时,需要在 application.properties 中设置如下信息。
rocketmq.config.namesrvAddr=安装Rocket服务器地址:设置的端口号
# 端口号默认是 9876
# 如果 RocketMQ 安装在 Linux上,那么就设置为 Linux 的 ip地址:9876
# 如果 RocketMQ 安装在 Windows 上,那么就设置为 127.0.0.1:9876
就可以解决上述问题了。
解决完之后将 dashboard 打成 jar 包使用即可。