[ 
https://issues.apache.org/jira/browse/ROCKETMQ-109?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jaskey Lam updated ROCKETMQ-109:
--------------------------------
    Description: 
{code}
private RemotingCommand ViewBrokerStatsData(ChannelHandlerContext ctx, 
RemotingCommand request) throws RemotingCommandException {
        ..//others
        DefaultMessageStore messageStore = (DefaultMessageStore) 
this.brokerController.getMessageStore();//will result in ClassCastException 
when using plugin because plugin is not type of "DefaultMessageStore "
       ..//others
{code}


I suggest adding a interface "getStatsItem" to MessageStore to avoid type cast.

  was:
private RemotingCommand ViewBrokerStatsData(ChannelHandlerContext ctx, 
RemotingCommand request) throws RemotingCommandException {
        ..//others
        DefaultMessageStore messageStore = (DefaultMessageStore) 
this.brokerController.getMessageStore();//will result in ClassCastException 
when using plugin because plugin is not type of "DefaultMessageStore "
       ..//others



I suggest adding a interface "getStatsItem" to MessageStore to avoid type cast.


> View BrokerStats may result in ClassCastException when using store plugin
> -------------------------------------------------------------------------
>
>                 Key: ROCKETMQ-109
>                 URL: https://issues.apache.org/jira/browse/ROCKETMQ-109
>             Project: Apache RocketMQ
>          Issue Type: Bug
>          Components: rocketmq-broker
>            Reporter: Jaskey Lam
>            Assignee: yukon
>
> {code}
> private RemotingCommand ViewBrokerStatsData(ChannelHandlerContext ctx, 
> RemotingCommand request) throws RemotingCommandException {
>         ..//others
>         DefaultMessageStore messageStore = (DefaultMessageStore) 
> this.brokerController.getMessageStore();//will result in ClassCastException 
> when using plugin because plugin is not type of "DefaultMessageStore "
>        ..//others
> {code}
> I suggest adding a interface "getStatsItem" to MessageStore to avoid type 
> cast.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to