Samreay opened a new issue, #193:
URL: https://github.com/apache/pulsar-client-python/issues/193

   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:
   
   ```bash
   docker run -it -p 6650:6650 -p 8080:8080 --tmpfs /pulsar/data 
apachepulsar/pulsar:3.1.0 bin/pulsar standalone
   ```
   
   Then, run this code:
   
   ```python
   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.


-- 
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]

Reply via email to