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 #1561]Support specify max reconsume times in message level #1562

Closed

Conversation

Jaskey
Copy link
Contributor

@Jaskey Jaskey commented Oct 31, 2019

What is the purpose of the change

setting MAX_RECONSUME_TIMES in message has no effect to control max reconsume times, this pr is intending to fix this issue.

Since the retry strategy between consuming concurrently and consuming orderly, this pr is going to enhance concurrently only

Brief changelog

When user need to control max reconsume times for a specific message, user may set MAX_RECONSUME_TIMES in the message property, it should be effected. But currently, it is not, only max reconsume times in consumer level will be effected.

    consumer.registerMessageListener(new MessageListenerConcurrently() {

        @Override
        public ConsumeConcurrentlyStatus consumeMessage(List<MessageExt> msgs,
            ConsumeConcurrentlyContext context) {
            System.out.printf("%s Receive New Messages: %s %n", Thread.currentThread().getName(), msgs);
            
            for (MessageExt msg : msgs) {
                if (msg.getTopic().equals("TOPICA")) {
                    MessageAccessor.setMaxReconsumeTimes(msg, "5");//reconsume to 5 times if consome message from topicA fail 
                }
            }
            
            //do consume now 
            if (consumefail){
                return ConsumeConcurrentlyStatus.RECONSUME_LATER;
            }

            return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;
        }
    });

@coveralls
Copy link

coveralls commented Oct 31, 2019

Coverage Status

Coverage increased (+0.007%) to 51.208% when pulling 6c019c4 on Jaskey:dev-support-maxreconsumetimes-in-msg into 583f665 on apache:develop.

@Jaskey Jaskey changed the title Support specify max reconsume times in message level #1561 [ISSUE #1561]Support specify max reconsume times in message level Oct 31, 2019
@YuShanMuGong
Copy link

YuShanMuGong commented Nov 4, 2019

你好,你这个修改,只修改了并行消费模式的最大重试次数。。我觉得既然是个消息级别的设置,那么应该在各种消费模式下都能起作用。

我尝试写了一版功能,你能帮我Review一下吗?PR1570

@Jaskey
Copy link
Contributor Author

Jaskey commented Jun 10, 2020

@YuShanMuGong Yes, this is only effective for concurrently service, since it is most popular. For orderly consume service, it may be different since it does not redeliever so it is not included in this pr

@Jaskey Jaskey force-pushed the dev-support-maxreconsumetimes-in-msg branch from 9f2ee75 to 6c019c4 Compare June 10, 2020 10:03
@Jaskey
Copy link
Contributor Author

Jaskey commented Jun 10, 2020

@duhenglucky would you please help to review this pr?

@codecov-commenter
Copy link

Codecov Report

Merging #1562 into develop will increase coverage by 0.04%.
The diff coverage is 0.00%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #1562      +/-   ##
=============================================
+ Coverage      45.42%   45.47%   +0.04%     
- Complexity      4242     4247       +5     
=============================================
  Files            545      545              
  Lines          35843    35850       +7     
  Branches        4762     4764       +2     
=============================================
+ Hits           16283    16304      +21     
+ Misses         17511    17494      -17     
- Partials        2049     2052       +3     
Impacted Files Coverage Δ Complexity Δ
...lient/impl/consumer/DefaultMQPushConsumerImpl.java 8.72% <0.00%> (-0.11%) 11.00 <0.00> (ø)
...ain/java/org/apache/rocketmq/test/util/MQWait.java 43.24% <0.00%> (-10.82%) 3.00% <0.00%> (-1.00%)
...in/java/org/apache/rocketmq/test/util/MQAdmin.java 38.88% <0.00%> (-5.56%) 7.00% <0.00%> (-1.00%)
...ava/org/apache/rocketmq/test/util/VerifyUtils.java 46.26% <0.00%> (-2.99%) 14.00% <0.00%> (-1.00%)
...a/org/apache/rocketmq/filter/util/BloomFilter.java 59.13% <0.00%> (-2.16%) 25.00% <0.00%> (-1.00%)
.../rocketmq/broker/filter/ConsumerFilterManager.java 72.19% <0.00%> (-0.90%) 33.00% <0.00%> (ø%)
...rocketmq/client/impl/factory/MQClientInstance.java 46.82% <0.00%> (-0.60%) 82.00% <0.00%> (ø%)
.../apache/rocketmq/logging/inner/LoggingBuilder.java 63.60% <0.00%> (-0.32%) 3.00% <0.00%> (ø%)
...g/apache/rocketmq/client/impl/MQClientAPIImpl.java 12.63% <0.00%> (-0.22%) 25.00% <0.00%> (-1.00%)
...main/java/org/apache/rocketmq/store/CommitLog.java 67.22% <0.00%> (-0.11%) 80.00% <0.00%> (ø%)
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 583f665...6c019c4. Read the comment docs.

@github-actions
Copy link

This PR is stale because it has been open for 365 days with no activity. It will be closed in 3 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this PR.

@github-actions github-actions bot added the stale label Jul 26, 2023
@github-actions
Copy link

This PR was closed because it has been inactive for 3 days since being marked as stale.

@github-actions github-actions bot closed this Jul 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants