adamdelezuch89 opened a new issue, #199:
URL: https://github.com/apache/pulsar-client-python/issues/199
Hi,
Reader.has_message_available() returns True on first execution, even if no
message available on topic. Issue is only, when reader is created with
start_message_id=pulsar.MessageId.earliest,
# Reproduction
```
from my_schemas import Schema
import pulsar
pulsar_url = "localhost"
topic = "tenant/namespace/topic"
name = "name"
schema = pulsar.schema.AvroSchema(Schema)
client = pulsar.Client(pulsar_url)
reader = client.create_reader(
topic=topic,
start_message_id=pulsar.MessageId.earliest,
schema=schema,
reader_name=name,
)
reader.seek(pulsar.MessageId.latest) # Or any last message on topic
while True:
if not reader.has_message_available(): # It is True on first iteration
but should be False
break
msg = reader.read_next(timeout_millis=5000) # Raises unexpected TIMEOUT
exception
print("No more messages")
```
--
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]