Describe the bug
Python API describes option reader_listener but it causes an exception when used.
To Reproduce
Steps to reproduce the behavior:
import pulsar
client = pulsar.Client('pulsar://localhost:6650')
msg_id = pulsar.MessageId.earliest
def foo(*a, **b):
pass
reader = client.create_reader('my-topic', msg_id, reader_listener=foo)
while True:
msg = reader.read_next()
print("Received message %r id=%s" % (msg.data(), msg.message_id()))
Generates the following exception:
Traceback (most recent call last):
File "read.py", line 9, in <module>
reader = client.create_reader('my-topic', msg_id, reader_listener=foo)
File "/usr/local/lib/python3.6/dist-packages/pulsar/__init__.py", line 684, in create_reader
conf.reader_listener(_listener_wrapper(reader_listener, schema))
AttributeError: 'ReaderConfiguration' object has no attribute 'reader_listener'
Expected behavior
To configure reader successfully
Screenshots
N/A
Desktop (please complete the following information):
N/A
Additional context
Issue separated out from #5365
pulsar-client-cpp/python/src/config.cc says:
class_<ReaderConfiguration>("ReaderConfiguration")
.def("message_listener", &ReaderConfiguration_setReaderListener, return_self<>())
But the python code in pulsar-client-cpp/python/pulsar/__init__.py calls conf.reader_listener instead:
conf = _pulsar.ReaderConfiguration()
if reader_listener:
conf.reader_listener(_listener_wrapper(reader_listener, schema))
I suspect the former is a typo and should change to .def("reader_listener")
(I don't have a build env setup to test this. Also, probably should have a test case adding to pick this problem up)
Describe the bug
Python API describes option
reader_listenerbut it causes an exception when used.To Reproduce
Steps to reproduce the behavior:
Generates the following exception:
Expected behavior
To configure reader successfully
Screenshots
N/A
Desktop (please complete the following information):
N/A
Additional context
Issue separated out from #5365
pulsar-client-cpp/python/src/config.ccsays:But the python code in
pulsar-client-cpp/python/pulsar/__init__.pycallsconf.reader_listenerinstead:I suspect the former is a typo and should change to
.def("reader_listener")(I don't have a build env setup to test this. Also, probably should have a test case adding to pick this problem up)