You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@rocketmq.apache.org by "Jaskey Lam (JIRA)" <ji...@apache.org> on 2017/02/24 06:35:44 UTC

[jira] [Updated] (ROCKETMQ-109) View BrokerStats may result in ClassCastException when using store plugin

     [ 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)