Uploaded image for project: 'Apache RocketMQ'
  1. Apache RocketMQ
  2. ROCKETMQ-209

Duplicated code in class MQClientAPIImpl

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 4.0.0-incubating, 4.1.0-incubating, 4.2.0, 4.3.0
    • Fix Version/s: None
    • Component/s: rocketmq-client
    • Labels:
      None
    • Environment:
      All Environments

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              vintagewang Xiaorui Wang
              Reporter:
              binzhaomobile binzhaomobile
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: