You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/05/08 07:57:01 UTC

[GitHub] [rocketmq] Oliverwqcwrw opened a new pull request, #4258: [Polish] Optimized code

Oliverwqcwrw opened a new pull request, #4258:
URL: https://github.com/apache/rocketmq/pull/4258

   **Make sure set the target branch to `develop`**
   
   ## What is the purpose of the change
   
   Optimized code
   
   Follow this checklist to help us incorporate your contribution quickly and easily. Notice, `it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR`.
   
   - [x] Make sure there is a [Github issue](https://github.com/apache/rocketmq/issues) filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue. 
   - [x] Format the pull request title like `[ISSUE #123] Fix UnknownException when host config not exist`. Each commit in the pull request should have a meaningful subject line and body.
   - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   - [x] Write necessary unit-test(over 80% coverage) to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in [test module](https://github.com/apache/rocketmq/tree/master/test).
   - [x] Run `mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle` to make sure basic checks pass. Run `mvn clean install -DskipITs` to make sure unit-test pass. Run `mvn clean test-compile failsafe:integration-test`  to make sure integration-test pass.
   - [ ] If this contribution is large, please file an [Apache Individual Contributor License Agreement](http://www.apache.org/licenses/#clas).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] Oliverwqcwrw commented on a diff in pull request #4258: [Polish] Optimized code

Posted by GitBox <gi...@apache.org>.
Oliverwqcwrw commented on code in PR #4258:
URL: https://github.com/apache/rocketmq/pull/4258#discussion_r867464210


##########
client/src/main/java/org/apache/rocketmq/client/producer/DefaultMQProducer.java:
##########
@@ -896,7 +894,6 @@ public QueryResult queryMessage(String topic, String key, int maxNum, long begin
     public MessageExt viewMessage(String topic,
         String msgId) throws RemotingException, MQBrokerException, InterruptedException, MQClientException {
         try {
-            MessageId oldMsgId = MessageDecoder.decodeMessageId(msgId);
             return this.viewMessage(msgId);
         } catch (Exception e) {
         }

Review Comment:
   Good idea



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] hzh0425 commented on a diff in pull request #4258: [Polish] Optimized code

Posted by GitBox <gi...@apache.org>.
hzh0425 commented on code in PR #4258:
URL: https://github.com/apache/rocketmq/pull/4258#discussion_r867462310


##########
client/src/main/java/org/apache/rocketmq/client/producer/DefaultMQProducer.java:
##########
@@ -896,7 +894,6 @@ public QueryResult queryMessage(String topic, String key, int maxNum, long begin
     public MessageExt viewMessage(String topic,
         String msgId) throws RemotingException, MQBrokerException, InterruptedException, MQClientException {
         try {
-            MessageId oldMsgId = MessageDecoder.decodeMessageId(msgId);
             return this.viewMessage(msgId);
         } catch (Exception e) {
         }

Review Comment:
   You can rename the 'Exception e' to 'Exception ignored'



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] hzh0425 commented on a diff in pull request #4258: [Polish] Optimized code

Posted by GitBox <gi...@apache.org>.
hzh0425 commented on code in PR #4258:
URL: https://github.com/apache/rocketmq/pull/4258#discussion_r867887707


##########
client/src/main/java/org/apache/rocketmq/client/producer/DefaultMQProducer.java:
##########
@@ -896,7 +894,6 @@ public QueryResult queryMessage(String topic, String key, int maxNum, long begin
     public MessageExt viewMessage(String topic,
         String msgId) throws RemotingException, MQBrokerException, InterruptedException, MQClientException {
         try {
-            MessageId oldMsgId = MessageDecoder.decodeMessageId(msgId);
             return this.viewMessage(msgId);
         } catch (Exception e) {
         }

Review Comment:
   Oh, this method is 'Deprecated', just ignore it



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] codecov-commenter commented on pull request #4258: [Polish] Optimized code

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #4258:
URL: https://github.com/apache/rocketmq/pull/4258#issuecomment-1120378275

   # [Codecov](https://codecov.io/gh/apache/rocketmq/pull/4258?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#4258](https://codecov.io/gh/apache/rocketmq/pull/4258?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (15f74bf) into [develop](https://codecov.io/gh/apache/rocketmq/commit/d7e940a29ad32cacbe5ae8fd64d8ce6b968c70aa?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (d7e940a) will **decrease** coverage by `0.13%`.
   > The diff coverage is `20.00%`.
   
   ```diff
   @@              Coverage Diff              @@
   ##             develop    #4258      +/-   ##
   =============================================
   - Coverage      48.13%   47.99%   -0.14%     
   + Complexity      5074     5056      -18     
   =============================================
     Files            642      642              
     Lines          42783    42783              
     Branches        5600     5601       +1     
   =============================================
   - Hits           20594    20535      -59     
   - Misses         19673    19732      +59     
     Partials        2516     2516              
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/rocketmq/pull/4258?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ketmq/client/consumer/DefaultLitePullConsumer.java](https://codecov.io/gh/apache/rocketmq/pull/4258/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jbGllbnQvY29uc3VtZXIvRGVmYXVsdExpdGVQdWxsQ29uc3VtZXIuamF2YQ==) | `76.07% <ø> (ø)` | |
   | [...ocketmq/client/consumer/DefaultMQPullConsumer.java](https://codecov.io/gh/apache/rocketmq/pull/4258/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jbGllbnQvY29uc3VtZXIvRGVmYXVsdE1RUHVsbENvbnN1bWVyLmphdmE=) | `33.33% <ø> (ø)` | |
   | [...ocketmq/client/consumer/DefaultMQPushConsumer.java](https://codecov.io/gh/apache/rocketmq/pull/4258/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jbGllbnQvY29uc3VtZXIvRGVmYXVsdE1RUHVzaENvbnN1bWVyLmphdmE=) | `57.92% <0.00%> (-0.50%)` | :arrow_down: |
   | [...lient/impl/consumer/DefaultMQPullConsumerImpl.java](https://codecov.io/gh/apache/rocketmq/pull/4258/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jbGllbnQvaW1wbC9jb25zdW1lci9EZWZhdWx0TVFQdWxsQ29uc3VtZXJJbXBsLmphdmE=) | `29.68% <0.00%> (-0.09%)` | :arrow_down: |
   | [...he/rocketmq/client/producer/DefaultMQProducer.java](https://codecov.io/gh/apache/rocketmq/pull/4258/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jbGllbnQvcHJvZHVjZXIvRGVmYXVsdE1RUHJvZHVjZXIuamF2YQ==) | `58.09% <100.00%> (+0.74%)` | :arrow_up: |
   | [.../broker/subscription/SubscriptionGroupManager.java](https://codecov.io/gh/apache/rocketmq/pull/4258/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9icm9rZXIvc3Vic2NyaXB0aW9uL1N1YnNjcmlwdGlvbkdyb3VwTWFuYWdlci5qYXZh) | `64.70% <0.00%> (-16.48%)` | :arrow_down: |
   | [...ache/rocketmq/common/stats/MomentStatsItemSet.java](https://codecov.io/gh/apache/rocketmq/pull/4258/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jb21tb24vc3RhdHMvTW9tZW50U3RhdHNJdGVtU2V0LmphdmE=) | `39.13% <0.00%> (-4.35%)` | :arrow_down: |
   | [...lient/impl/consumer/DefaultMQPushConsumerImpl.java](https://codecov.io/gh/apache/rocketmq/pull/4258/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jbGllbnQvaW1wbC9jb25zdW1lci9EZWZhdWx0TVFQdXNoQ29uc3VtZXJJbXBsLmphdmE=) | `39.96% <0.00%> (-3.88%)` | :arrow_down: |
   | [...ava/org/apache/rocketmq/filter/util/BitsArray.java](https://codecov.io/gh/apache/rocketmq/pull/4258/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZmlsdGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9maWx0ZXIvdXRpbC9CaXRzQXJyYXkuamF2YQ==) | `59.82% <0.00%> (-2.57%)` | :arrow_down: |
   | [...ache/rocketmq/store/AllocateMappedFileService.java](https://codecov.io/gh/apache/rocketmq/pull/4258/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3RvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3N0b3JlL0FsbG9jYXRlTWFwcGVkRmlsZVNlcnZpY2UuamF2YQ==) | `39.02% <0.00%> (-2.44%)` | :arrow_down: |
   | ... and [17 more](https://codecov.io/gh/apache/rocketmq/pull/4258/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/rocketmq/pull/4258?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/rocketmq/pull/4258?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [d7e940a...15f74bf](https://codecov.io/gh/apache/rocketmq/pull/4258?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] ShannonDing merged pull request #4258: [ISSUE #4326] Optimized code

Posted by GitBox <gi...@apache.org>.
ShannonDing merged PR #4258:
URL: https://github.com/apache/rocketmq/pull/4258


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] Oliverwqcwrw commented on a diff in pull request #4258: [Polish] Optimized code

Posted by GitBox <gi...@apache.org>.
Oliverwqcwrw commented on code in PR #4258:
URL: https://github.com/apache/rocketmq/pull/4258#discussion_r867464047


##########
client/src/main/java/org/apache/rocketmq/client/consumer/DefaultMQPushConsumer.java:
##########
@@ -417,7 +417,7 @@ public void createTopic(String key, String newTopic, int queueNum) throws MQClie
     @Override
     public void setUseTLS(boolean useTLS) {
         super.setUseTLS(useTLS);
-        if (traceDispatcher != null && traceDispatcher instanceof AsyncTraceDispatcher) {

Review Comment:
   IMO,Null is not an instanceof anything, so a null check is redundant.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] coveralls commented on pull request #4258: [Polish] Optimized code

Posted by GitBox <gi...@apache.org>.
coveralls commented on PR #4258:
URL: https://github.com/apache/rocketmq/pull/4258#issuecomment-1120379643

   
   [![Coverage Status](https://coveralls.io/builds/48926177/badge)](https://coveralls.io/builds/48926177)
   
   Coverage decreased (-0.07%) to 52.051% when pulling **15f74bfe75b7fa4ec85b58c4d5c209ac5f30d355 on Oliverwqcwrw:develop-polish-7** into **d7e940a29ad32cacbe5ae8fd64d8ce6b968c70aa on apache:develop**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] coveralls commented on pull request #4258: [Polish] Optimized code

Posted by GitBox <gi...@apache.org>.
coveralls commented on PR #4258:
URL: https://github.com/apache/rocketmq/pull/4258#issuecomment-1120379644

   
   [![Coverage Status](https://coveralls.io/builds/48926177/badge)](https://coveralls.io/builds/48926177)
   
   Coverage decreased (-0.07%) to 52.051% when pulling **15f74bfe75b7fa4ec85b58c4d5c209ac5f30d355 on Oliverwqcwrw:develop-polish-7** into **d7e940a29ad32cacbe5ae8fd64d8ce6b968c70aa on apache:develop**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] li-xiao-shuang commented on pull request #4258: [Polish] Optimized code

Posted by GitBox <gi...@apache.org>.
li-xiao-shuang commented on PR #4258:
URL: https://github.com/apache/rocketmq/pull/4258#issuecomment-1120378151

   LGTM


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] hzh0425 commented on a diff in pull request #4258: [Polish] Optimized code

Posted by GitBox <gi...@apache.org>.
hzh0425 commented on code in PR #4258:
URL: https://github.com/apache/rocketmq/pull/4258#discussion_r867461821


##########
client/src/main/java/org/apache/rocketmq/client/consumer/DefaultMQPushConsumer.java:
##########
@@ -417,7 +417,7 @@ public void createTopic(String key, String newTopic, int queueNum) throws MQClie
     @Override
     public void setUseTLS(boolean useTLS) {
         super.setUseTLS(useTLS);
-        if (traceDispatcher != null && traceDispatcher instanceof AsyncTraceDispatcher) {

Review Comment:
   I think 'traceDispatcher != null' is still needed



##########
client/src/main/java/org/apache/rocketmq/client/producer/DefaultMQProducer.java:
##########
@@ -896,7 +894,6 @@ public QueryResult queryMessage(String topic, String key, int maxNum, long begin
     public MessageExt viewMessage(String topic,
         String msgId) throws RemotingException, MQBrokerException, InterruptedException, MQClientException {
         try {
-            MessageId oldMsgId = MessageDecoder.decodeMessageId(msgId);
             return this.viewMessage(msgId);
         } catch (Exception e) {
         }

Review Comment:
   Oh, this method was  'Deprecated', just ignore it



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] Oliverwqcwrw commented on a diff in pull request #4258: [Polish] Optimized code

Posted by GitBox <gi...@apache.org>.
Oliverwqcwrw commented on code in PR #4258:
URL: https://github.com/apache/rocketmq/pull/4258#discussion_r867464210


##########
client/src/main/java/org/apache/rocketmq/client/producer/DefaultMQProducer.java:
##########
@@ -896,7 +894,6 @@ public QueryResult queryMessage(String topic, String key, int maxNum, long begin
     public MessageExt viewMessage(String topic,
         String msgId) throws RemotingException, MQBrokerException, InterruptedException, MQClientException {
         try {
-            MessageId oldMsgId = MessageDecoder.decodeMessageId(msgId);
             return this.viewMessage(msgId);
         } catch (Exception e) {
         }

Review Comment:
   Good idea



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] hzh0425 commented on a diff in pull request #4258: [Polish] Optimized code

Posted by GitBox <gi...@apache.org>.
hzh0425 commented on code in PR #4258:
URL: https://github.com/apache/rocketmq/pull/4258#discussion_r867461821


##########
client/src/main/java/org/apache/rocketmq/client/consumer/DefaultMQPushConsumer.java:
##########
@@ -417,7 +417,7 @@ public void createTopic(String key, String newTopic, int queueNum) throws MQClie
     @Override
     public void setUseTLS(boolean useTLS) {
         super.setUseTLS(useTLS);
-        if (traceDispatcher != null && traceDispatcher instanceof AsyncTraceDispatcher) {

Review Comment:
   I thanks 'traceDispatcher != null' is still needed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] Oliverwqcwrw commented on a diff in pull request #4258: [Polish] Optimized code

Posted by GitBox <gi...@apache.org>.
Oliverwqcwrw commented on code in PR #4258:
URL: https://github.com/apache/rocketmq/pull/4258#discussion_r867465820


##########
client/src/main/java/org/apache/rocketmq/client/producer/DefaultMQProducer.java:
##########
@@ -896,7 +894,6 @@ public QueryResult queryMessage(String topic, String key, int maxNum, long begin
     public MessageExt viewMessage(String topic,
         String msgId) throws RemotingException, MQBrokerException, InterruptedException, MQClientException {
         try {
-            MessageId oldMsgId = MessageDecoder.decodeMessageId(msgId);
             return this.viewMessage(msgId);
         } catch (Exception e) {
         }

Review Comment:
   Would it be better to print the exception message?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] li-xiao-shuang commented on a diff in pull request #4258: [Polish] Optimized code

Posted by GitBox <gi...@apache.org>.
li-xiao-shuang commented on code in PR #4258:
URL: https://github.com/apache/rocketmq/pull/4258#discussion_r867464334


##########
client/src/main/java/org/apache/rocketmq/client/consumer/DefaultMQPushConsumer.java:
##########
@@ -417,7 +417,7 @@ public void createTopic(String key, String newTopic, int queueNum) throws MQClie
     @Override
     public void setUseTLS(boolean useTLS) {
         super.setUseTLS(useTLS);
-        if (traceDispatcher != null && traceDispatcher instanceof AsyncTraceDispatcher) {

Review Comment:
   > IMO,Null is not an instanceof anything, so a null check is redundant.
   
   Agree with



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] Oliverwqcwrw commented on a diff in pull request #4258: [Polish] Optimized code

Posted by GitBox <gi...@apache.org>.
Oliverwqcwrw commented on code in PR #4258:
URL: https://github.com/apache/rocketmq/pull/4258#discussion_r867893688


##########
client/src/main/java/org/apache/rocketmq/client/producer/DefaultMQProducer.java:
##########
@@ -896,7 +894,6 @@ public QueryResult queryMessage(String topic, String key, int maxNum, long begin
     public MessageExt viewMessage(String topic,
         String msgId) throws RemotingException, MQBrokerException, InterruptedException, MQClientException {
         try {
-            MessageId oldMsgId = MessageDecoder.decodeMessageId(msgId);
             return this.viewMessage(msgId);
         } catch (Exception e) {
         }

Review Comment:
   Ok,I will solve it



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org