williamxww opened a new issue #411: 扩展MessageStore后,如果开着rocketmq-console, broker会刷异常日志 URL: https://github.com/apache/rocketmq/issues/411 环境: rocket-mq 4.2.0 rocketmq-console-ng 1.0.0 异常日志: ``` java.lang.ClassCastException: com.xxxx.rocketmq.store.UnmPluginMessageStore cannot be cast to org.apache.rocketmq.store.DefaultMessageStore at org.apache.rocketmq.broker.processor.AdminBrokerProcessor.ViewBrokerStatsData(AdminBrokerProcessor.java:1053) ~[rocketmq-broker-4.2.0.jar:4.2.0] at org.apache.rocketmq.broker.processor.AdminBrokerProcessor.processRequest(AdminBrokerProcessor.java:198) ~[rocketmq-broker-4.2.0.jar:4.2.0] at org.apache.rocketmq.remoting.netty.NettyRemotingAbstract$1.run(NettyRemotingAbstract.java:178) ~[rocketmq-remoting-4.2.0.jar:4.2.0] at org.apache.rocketmq.remoting.netty.RequestTask.run(RequestTask.java:80) [rocketmq-remoting-4.2.0.jar:4.2.0] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_45] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_45] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_45] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_45] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_45] 2018-08-13 20\:28\:55 ERROR AdminBrokerThread_13 - RemotingCommand [code=315, language=JAVA, version=212, opaque=12466, flag(B)=0, remark=null, extFields={statsName=GROUP_GET_NUMS, statsKey=Temp_0@unm}, serializeTypeCurrentRPC=JSON] ``` 问题代码:org.apache.rocketmq.broker.processor.AdminBrokerProcessor#ViewBrokerStatsData 中brokerController.getMessageStore()取出来的可能是AbstractPluginMessageStore的子类,不一定是DefaultMessageStore,这里需要更细致的处理。 ```java private RemotingCommand ViewBrokerStatsData(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final ViewBrokerStatsDataRequestHeader requestHeader = (ViewBrokerStatsDataRequestHeader) request.decodeCommandCustomHeader(ViewBrokerStatsDataRequestHeader.class); final RemotingCommand response = RemotingCommand.createResponseCommand(null); DefaultMessageStore messageStore = (DefaultMessageStore) this.brokerController.getMessageStore(); ... ```
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
