You can query the topic stats. There is a "backlog" field in topic stats.
It will tell you how many messages that a subscription has not consumed. It
is similar as consumer lag in Kafka.

Thanks,
Sijie

On Mon, Jul 22, 2019 at 6:46 PM Enrico Olivelli <[email protected]> wrote:

> Hello,
>
> I am looking for a function in Pulsar API to get the current consumer "lag"
>
> I see that Pulsar recently added getLastMessageId API but this is not
> useful to me
> https://pulsar.apache.org/admin-rest-api/#operation/getLastMessageId
>
> In Pulsar if you have two message ids you cannot compute any kind of
> "distance".
>
> I am migrating from Kafka and in Kafka the message id is an incremental
> number (per partition).
>
> I am using the Reader API, and I am storing the last processed messageId
> in an external system, this way I have full control over the portion of the
> stream that I am processing.
>
> I think Sijie or Jia already told me something about this topic but I
> can't find references
>
> Thanks in advance
>
> Enrico
>
>
>

Reply via email to