You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@rocketmq.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2017/08/11 12:00:02 UTC

[jira] [Commented] (ROCKETMQ-209) Duplicated code in class MQClientAPIImpl

    [ https://issues.apache.org/jira/browse/ROCKETMQ-209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16123251#comment-16123251 ] 

ASF subversion and git services commented on ROCKETMQ-209:
----------------------------------------------------------

Commit ffad6566b8aee86b87b34f2c77ab2ae3b9c15b1c in incubator-rocketmq's branch refs/heads/develop from [~Rito]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-rocketmq.git;h=ffad656 ]

[ROCKETMQ-209]Remove duplicated code in class MQClientAPIImpl

Author: Ritabrata Moitra <rm...@thoughtworks.com>

Closes #134 from Ritabrata-TW/master.


> Duplicated code in class MQClientAPIImpl
> ----------------------------------------
>
>                 Key: ROCKETMQ-209
>                 URL: https://issues.apache.org/jira/browse/ROCKETMQ-209
>             Project: Apache RocketMQ
>          Issue Type: Bug
>          Components: rocketmq-client
>    Affects Versions: 4.0.0-incubating, 4.1.0-incubating, 4.2.0-incubating, 4.3.0-incubating
>         Environment: All Environments
>            Reporter: binzhaomobile
>            Assignee: Xiaorui Wang
>            Priority: Minor
>
> In class MQClientAPIImpl, the two functions getDefaultTopicRouteInfoFromNameServer and getTopicRouteInfoFromNameServer almost have the same code. The only difference is the way to handle the situation when topic does not exist. Suggestion to fix this issue:
> 1) Add a new function: public TopicRouteData getTopicRouteInfoFromNameServer(final String topic, final long timeoutMillis, boolean allowTopicNotExist).
> 2) Merge the code from getDefaultTopicRouteInfoFromNameServer and getTopicRouteInfoFromNameServer into the new function so that it can handle both case.
> 3) Change getDefaultTopicRouteInfoFromNameServer and getTopicRouteInfoFromNameServer to call the new function with   allowTopicNotExist parameter true or false.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)