You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Reader does not return any message when configured with reading inclusive latest messageId #10483
Describe the bug
Creating reader with messageId pointing to MessageId.latest together with startMessageIdInclusive,there is no message returned when readNext is invoked. Newly coming messages are consumed. When using MessageId.earliest, a message is returned - means there are messages in that topic.
Having running local docker image with puslar 2.7.1 and java client 2.7.1
Expected behavior
Last message in queue is returned when calling Reader.readNext with Reader configuration MessageId.latest and startMessageIdInclusive()
Similar Issue
Seems, it was already reported in issue 4912 in first paragraph Test3
Test3:When configuring Reader with startMessageIdInclusive and positioning stream at MessageId.latest, then the next call to Reader.readNext(timeout) should have returned the last message of the topic, but it times out and returns null (without a configured timeout it blocks forever).
.....
Expected behavior
test3 expected to return the last message in topic, test4 hasMessageAvailable expected to be false.
but it is little bit confusing because underlying method readMessage starts with hasMessageAvailable() which in that time returns wrongly true and readNext is reached but no message is returned, but should be.
changed the title [-]Reader does not return any message when configured with start with inclusive latest messageId [/-][+]Reader does not return any message when configured with reading inclusive latest messageId[/+]on May 5, 2021
If you invoke reader.hasMessageAvailable() before reader.readNext() then it works as expected.
It looks like in that case during searching if there're any messages available a message id for the last message is found and the reader pointer is set for it.
Logs:
17:14:42.290 [] [pulsar-client-io-1-1] INFO Get topic last message Id
17:14:42.290 [] [pulsar-client-io-1-1] INFO Successfully getLastMessageId 150:0
17:14:42.293 [] [pulsar-client-io-1-1] INFO Seek subscription to message id 150:0:-1
17:14:42.308 [] [pulsar-client-io-1-1] INFO Successfully reset subscription to message id 150:0:-1
You can use it as a workaround, but still this issue should be fixed.
Thanks @tomjohn9 for the report. This was reported on a Pulsar release before 3.0, which is no longer supported; the supported releases are 4.0.x, 4.2.x and 5.0.x. Much of the code involved has changed since, and the problem hasn't been confirmed on a current release, so I'm closing it as part of cleaning up old reports. If you still see it on a supported release, please open a new issue with the version and steps to reproduce, and link this one.
Activity
[-]Reader does not return any message when configured with start with inclusive latest messageId [/-][+]Reader does not return any message when configured with reading inclusive latest messageId[/+]PatrykWitkowski commentedon May 6, 2021
If you invoke
reader.hasMessageAvailable()beforereader.readNext()then it works as expected.It looks like in that case during searching if there're any messages available a message id for the last message is found and the reader pointer is set for it.
Logs:
You can use it as a workaround, but still this issue should be fixed.
adrianog commentedon May 7, 2021
Yes it should be fixed anyway. And please can startMessageIdInclusive be made available to c++/python as well. It is a glaring omission. #10328
codelipenghui commentedon Mar 15, 2022
Here is the discussion thread https://lists.apache.org/thread/kwljdckm0ykstq8oodz6550hqxdltc98 for this issue.
merlimat commentedon Oct 24, 2026
Thanks @tomjohn9 for the report. This was reported on a Pulsar release before 3.0, which is no longer supported; the supported releases are 4.0.x, 4.2.x and 5.0.x. Much of the code involved has changed since, and the problem hasn't been confirmed on a current release, so I'm closing it as part of cleaning up old reports. If you still see it on a supported release, please open a new issue with the version and steps to reproduce, and link this one.