mattisonchao opened a new pull request #14787:
URL: https://github.com/apache/pulsar/pull/14787
Fixes #14721
Master Issue: #14721
### Motivation
According to #14721, We got two points issue.
> 1. Most important I expect first message to be received is message '1ms'
and message '9001ms' after '8981ms'.
> 2. I expect start receiving messages after 10 seconds
The reason for point 1 is that the producer keeps sending messages (eg 500
messages) when it sends 400 messages, the current time exceeds the ``deliverAt'
set by the user, and the delayed messages will also be delivered at the same
time, but in Pulsar In the dispatch mechanism, the message 400 will be sent
directly to the consumer, and it will take precedence over messages that need
to be delayed.
The reason for point 2 is due to our addition of "tickTimeMillis" buffers in
"hasMessageAvailable", "getScheduledMessages" and "addMessage" methods. So when
"PersistentDispatcherMultipleConsumers#readMoreEntries" is called, the message
will be obtained earlier than "deliverAt".
### Modifications
- Remove ``tickTimeMillis`` buffer.
- Add collection to track ``unSentExpireMessage`` and based on this, it is
judged whether the message needs to be sent directly to the user.
### Verifying this change
- [x] Make sure that the change passes the CI checks.
### Documentation
- [x] `no-need-doc`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]