Skip to content

[C++] PartitionedConsumerImpl send redeliverMessages repeatedly  #9028

@saosir

Description

@saosir

Describe the bug
Both PartitionedConsumerImpl and ConsumerImpl have member variable unAckedMessageTrackerPtr_ (class UnAckedMessageTrackerEnabled), and PartitionedConsumerImpl is composed of ConsumerImpl. If the acknowledgement times out, they will send redeliverMessages repeatedly, MultiTopicsConsumerImpl has same problem.

see #8606 (comment)

To Reproduce

  1. subscribe a partitioned topic and set UnAckedMessagesTimeoutMs
Consumer consumer;
ConsumerConfiguration consumerConf;
consumerConf.setUnAckedMessagesTimeoutMs(11000);  // must >= 10000
consumerConf.setTickDurationInMs(11000);
Result result = client.subscribe("my-topic", "consumer-1", consumerConf, consumer);
  1. recevie a msg from partitioned topic and not do acknowledge
Message msg;
consumer.recevie(msg)
sleep(20000);
  1. sleep 20000ms to trigger redeliverMessages repeatedly
sleep(20000);

Expected behavior
Only one redeliverUnacknowledgedMessages should be sent in PartitionedConsumerImpl

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugThe PR fixed a bug or issue reported a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions