Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE #8070] Optimize the submitConsumeRequest and remove unnecessary exception catching #8071

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

biningo
Copy link

@biningo biningo commented Apr 26, 2024

Which Issue(s) This PR Fixes

Fixes #8070

@biningo
Copy link
Author

biningo commented Apr 26, 2024

If the number of messages or the consumeBatchSize is zero, it will work fine.

@biningo
Copy link
Author

biningo commented Apr 26, 2024

In submitConsumeRequest submitConsumeRequestLater is unnecessary.

@biningo
Copy link
Author

biningo commented Apr 30, 2024

Maven test fails in Ubuntu, but it seems to have nothing to do with this PR. @humkum Can you help me? Thanks!

@cserwen
Copy link
Member

cserwen commented May 10, 2024

Merge develop branch to fix the ut. @biningo

cserwen
cserwen previously approved these changes May 10, 2024
@biningo biningo force-pushed the optimize-submit-consume-request branch from 5efc688 to b8a638d Compare May 11, 2024 14:51
@biningo
Copy link
Author

biningo commented May 11, 2024

Merge develop branch to fix the ut. @biningo

OK, I've merged. Thanks for your help! :)

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 42.90%. Comparing base (159a603) to head (b8a638d).

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #8071      +/-   ##
=============================================
- Coverage      42.94%   42.90%   -0.05%     
+ Complexity     10387    10372      -15     
=============================================
  Files           1270     1270              
  Lines          88694    88679      -15     
  Branches       11401    11397       -4     
=============================================
- Hits           38092    38045      -47     
- Misses         45914    45940      +26     
- Partials        4688     4694       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

this.submitConsumeRequestLater(consumeRequest);
}
}
int batch = ((msgs.size() - 1) / consumeBatchSize) + 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line of code could be clearer. Readability is more important than reducing the number of lines.

Copy link
Author

@biningo biningo May 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah
It's not very readable here. I've optimized it. Thanks for your suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement] ConsumeMessageConcurrentlyService#submitConsumeRequest code should be more concise
5 participants