tomjohn9 opened a new issue #10483:
URL: https://github.com/apache/pulsar/issues/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
**Steps To Reproduce**
```
pulsarClient.newReader(JSONSchema.of(MySchema.class))
.topic(topic)
.startMessageId(MessageId.latest)
.startMessageIdInclusive().create()
.readNext(250, TimeUnit.MILLISECONDS)
```
**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](https://github.com/apache/pulsar/issues/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.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]