apache / pulsar-client-node

Apache Pulsar NodeJS Client
https://pulsar.apache.org/
Apache License 2.0
148 stars 86 forks source link

[feature request] Support Consumer.getLastMessageId #349

Open haphut opened 1 year ago

haphut commented 1 year ago

First off, thank you for all the development you do on Pulsar! :smile:

Motivation

When combining data from two Consumers by event timestamps and the topics have significant backlog, it gets tricky to make sure that all relevant events have arrived. If we could check from the Consumer whether we have already read the latest message, that would simplify the code.

The C++ client already supports Consumer.getLastMessageIdAsync. (Though the Java client has deprecated the singular version of that method, supposedly due to the Consumers being able to subscribe to several topics concurrently. For us right now the singular version is enough.)