rocketmq icon indicating copy to clipboard operation
rocketmq copied to clipboard

[ISSUE #3717][RIP-27] Auto batching in producer

Open guyinyou opened this issue 4 years ago • 7 comments

Make sure set the target branch to develop

What is the purpose of the change

#3717

Brief changelog

Realize the autobatch function in the producer.

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 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.
  • [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.

guyinyou avatar Jan 06 '22 09:01 guyinyou

refer #https://github.com/apache/rocketmq/wiki/RIP-27-Auto-batching-in-producer

RongtongJin avatar Jan 06 '22 13:01 RongtongJin

Coverage Status

Coverage increased (+0.1%) to 49.11% when pulling 418f157e9dea66a93faadf38db421780cabab019 on guyinyou:develop_feature_client_autoBatch into 3a1d1a7e60f9049fb7e5048a9f08cdcdbf996601 on apache:develop.

coveralls avatar Jan 10 '22 03:01 coveralls

Codecov Report

Merging #3718 (418f157) into develop (3a1d1a7) will increase coverage by 0.08%. The diff coverage is 60.75%.

@@              Coverage Diff              @@
##             develop    #3718      +/-   ##
=============================================
+ Coverage      44.75%   44.83%   +0.08%     
- Complexity      7526     7544      +18     
=============================================
  Files            975      976       +1     
  Lines          67378    67770     +392     
  Branches        8892     8952      +60     
=============================================
+ Hits           30153    30388     +235     
- Misses         33504    33621     +117     
- Partials        3721     3761      +40     
Impacted Files Coverage Δ
...he/rocketmq/client/producer/DefaultMQProducer.java 52.01% <38.29%> (-6.29%) :arrow_down:
...mq/client/impl/producer/DefaultMQProducerImpl.java 44.11% <60.86%> (-0.27%) :arrow_down:
...e/rocketmq/client/producer/ProduceAccumulator.java 67.89% <67.89%> (ø)
...g/apache/rocketmq/client/impl/MQClientManager.java 81.81% <72.72%> (-4.55%) :arrow_down:
...g/apache/rocketmq/common/message/MessageBatch.java 81.48% <100.00%> (ø)
...rg/apache/rocketmq/common/stats/StatsSnapshot.java 84.61% <0.00%> (-15.39%) :arrow_down:
...apache/rocketmq/broker/longpolling/PopRequest.java 31.03% <0.00%> (-13.80%) :arrow_down:
.../apache/rocketmq/common/stats/MomentStatsItem.java 38.09% <0.00%> (-9.53%) :arrow_down:
...ache/rocketmq/common/stats/MomentStatsItemSet.java 39.13% <0.00%> (-8.70%) :arrow_down:
...etmq/namesrv/routeinfo/BatchUnRegisterService.java 94.73% <0.00%> (-5.27%) :arrow_down:
... and 25 more

Help us with your feedback. Take ten seconds to tell us how you rate us.

codecov-commenter avatar Jan 10 '22 03:01 codecov-commenter

Whether there will be a performance improvement report in the future when using this feature

tianliuliu avatar Jan 20 '22 08:01 tianliuliu

@yuz10 There is no lamda expression in jdk1.6. For compatibility with it, replace computeIfAbsent with putIfAbsent.

guyinyou avatar Jan 27 '22 02:01 guyinyou

Whether there will be a performance improvement report in the future when using this feature

I plan to do some benchmarks after Chinese New Year, now here I wish you a happy new year.

guyinyou avatar Jan 27 '22 02:01 guyinyou

Since the new broker processes the messageBatch as a single message, it should not support the case of multiple topics in one messageBatch @duhenglucky

guyinyou avatar Mar 24 '22 06:03 guyinyou

LGTM~

RongtongJin avatar Jul 21 '23 01:07 RongtongJin