-
Notifications
You must be signed in to change notification settings - Fork 47
Closed
Description
Hi team,
When using start_message_id_inclusive
, we expect the message seeked to be returned. This is the case for the pulsar.MessageId.earliest
, but does not work with pulsar.MessageId.latest
.
Reproduction
First, run a pulsar standalone instance:
docker run -it -p 6650:6650 -p 8080:8080 --tmpfs /pulsar/data apachepulsar/pulsar:3.1.0 bin/pulsar standalone
Then, run this code:
import pulsar
host = "pulsar://localhost:6650"
topic = "example"
client = pulsar.Client(host)
producer = client.create_producer(topic)
producer.send(b"Hello world 1!")
producer.send(b"Hello world 2!")
earliest_reader = client.create_reader(topic, pulsar.MessageId.earliest, start_message_id_inclusive=True)
msg = earliest_reader.read_next()
print(msg.value())
# Prints Hello world 1!, as wanted
latest_reader = client.create_reader(topic, pulsar.MessageId.latest, start_message_id_inclusive=True)
msg = latest_reader.read_next(timeout_millis=5000)
print(msg.value())
# Times out
The behaviour of the earliest reader is as expected. But the latest reader should not time out.
DimiV9, AndreaPiccione, ojcm and petermnhull
Metadata
Metadata
Assignees
Labels
No labels