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

[Bug] Msg will be consumed even if it has reached max reconsumeTimes in some case #8332

Open
3 tasks done
cserwen opened this issue Jun 26, 2024 · 0 comments · May be fixed by #8333
Open
3 tasks done

[Bug] Msg will be consumed even if it has reached max reconsumeTimes in some case #8332

cserwen opened this issue Jun 26, 2024 · 0 comments · May be fixed by #8333

Comments

@cserwen
Copy link
Member

cserwen commented Jun 26, 2024

Before Creating the Bug Report

  • I found a bug, not just asking a question, which should be created in GitHub Discussions.

  • I have searched the GitHub Issues and GitHub Discussions of this repository and believe that this is not a duplicate.

  • I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.

Runtime platform environment

OS: linux

RocketMQ version

branch: develop

JDK Version

No response

Describe the Bug

PushConsumer use pop mode to consume, configurations is :

popInvisibleTime=10000   # 10s
clientRebalance=false # use pop mode
maxReconsumeTimes=0  # no retry

If consumption cost time is large than popInvisibleTime, it will still be consumed again and maxRecosumeTimes is not worked

Steps to Reproduce

DefaultMQPushConsumer consumer = new DefaultMQPushConsumer(CONSUMER_GROUP);
consumer.subscribe(TOPIC, "*");
consumer.setConsumeFromWhere(ConsumeFromWhere.CONSUME_FROM_FIRST_OFFSET);
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);
        try {
            Thread.sleep(15000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;
    }
});
consumer.setClientRebalance(false);
consumer.setPopInvisibleTime(10000);
consumer.setMaxReconsumeTimes(0);
consumer.start();
System.out.printf("Consumer Started.%n");

What Did You Expect to See?

Messages are consumed only once

What Did You See Instead?

Always being consumed

Additional Context

No response

@drpmma drpmma changed the title [Bug] Msg will be consumed even if it has reached mas reconsumeTimes in some case [Bug] Msg will be consumed even if it has reached max reconsumeTimes in some case Jun 26, 2024
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 a pull request may close this issue.

1 participant