Lanayx opened a new issue #10515:
URL: https://github.com/apache/pulsar/issues/10515
**Describe the bug**
I want to read messages starting from some timestamp, for that I use
`startMessageFromRollbackDuration` configuration. If there are messages
available i expect `hasMessageAvailable` to return true, and if no messages are
available it should return false. However it still returns true in the latter
cast.
**To Reproduce**
```java
Producer<byte[]> producer = client.newProducer()
.topic(topicName)
.enableBatching(false)
.sendTimeout(0, TimeUnit.MILLISECONDS)
.create();
MessageId msgId =
producer.newMessage().value(("Hello").getBytes()).send();
Thread.sleep(4000);
Reader<byte[]> reader = client.newReader()
.topic(topicName)
.startMessageFromRollbackDuration(1, TimeUnit.SECONDS)
.create();
Boolean result = reader.hasMessageAvailable();
System.out.printf("Result: %b\n", result); // returns true
```
**Expected behavior**
HasMessageAvailable should return false in the case above
**Additional context**
Client version 2.7.1 (reproduced in previous versions as well)
--
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]