Skip to content

when send a delayed message, there is a case pull duplicate messages #6403

Closed
@liudezhi2098

Description

Describe the bug
when send a delayed message ,there is a case when a consumer restarts and pull duplicate messages.

To Reproduce

1、send message

MessageId msgId = producer.newMessage()
                          .value("my-async-message".getBytes())
                          .deliverAfter(5000, TimeUnit.MILLISECONDS)
                          .send();
System.out.println(msgId.getMessageId())

Console

msgId=405:0:-1

2、Stop consumers in 5000ms, just produced message hasn't arrived

3、start conumers, then get two same messages,this is we do not want

 do {
       Message msg = consumer.receive();
       System.out.println(msg.getMessageId())
 }  while (true);

Console

405:0:-1
405:0:-1

Metadata

Assignees

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