apache / pulsar-client-python

Apache Pulsar Python client library
https://pulsar.apache.org/
Apache License 2.0
51 stars 39 forks source link

Python clients lacks startMessageIdInclusive setting #115

Closed Samreay closed 7 months ago

Samreay commented 1 year ago

Hi all,

As discussed in https://github.com/apache/pulsar/issues/10483 and https://github.com/apache/pulsar/issues/10328, it seems like the official way to get the latest message is to register a reader using startMessageIdInclusive and set the message id to latest.

It seems like the functionality was added in the C++ client over at https://github.com/apache/pulsar/pull/17209/files, however has yet to come to the python client itself.

I believe (and very happy to be proven wrong), that this means python clients have no way of actually getting the latest value apart from iterating from the start, which is seems... suboptimal.

I think the change is very simple, like adding the property to https://github.com/apache/pulsar-client-python/blob/main/src/config.cc#L276, adding it to the conf when making a reader, and updating the python signature. But the last time I wrote and compiled C++ was back in undergrad and I'm unsure how to even set up a development environment to contribute and test the issue.

BewareMyPower commented 1 year ago

I'm unsure how to even set up a development environment to contribute and test the issue.

The README provides the guide for how to test the issue. Regarding the development environment, you can use IDE like CLion. But for such simple changes, I think you can just write code via text editors and run the CLI commands referred in the README to test.

I admit the lack of documents for developers. Maybe we can add them later.

BTW, I developed the Python client via Vim with the coc.nvim plugin. Here is my .ccls file (in Linux) provided for the ccls LSP server:

g++
-std=c++11
-stdlib=libstdc++
-I
/home/xyz/software/pulsar-client-cpp/include
-I
/usr/include/python3.8
-I
./pybind11/include

I installed the C++ client to /home/xyz/software/pulsar-client-cpp and the PyBind11 source code in ./pybind11 by following the guide in REAMDE.

Samreay commented 7 months ago

This functionality seems here now, and have raised a separate issue about the start message id not working as expected here: https://github.com/apache/pulsar-client-python/issues/193

Closing this issue out