You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2023/04/28 02:59:37 UTC

[GitHub] [pulsar] BewareMyPower added a comment to the discussion: Using MessageID as a log sequence number downstream? Any better options?

GitHub user BewareMyPower added a comment to the discussion: Using MessageID as a log sequence number downstream? Any better options?

> Is it safe to rely on this internal undocumented structure of a MessageID? 

No. Or at least theoretically not.

> log sequence number

You can try the `BrokerMetadataInterceptor` feature, which is already used in [KoP](https://github.com/streamnative/kop).

```properties
brokerEntryMetadataInterceptors=org.apache.pulsar.common.intercept.AppendIndexMetadataInterceptor
```

Then you can use the `Message#getIndex` API to get the index, which is similar to Kafka's offset.

GitHub link: https://github.com/apache/pulsar/discussions/19969#discussioncomment-5749557

----
This is an automatically sent email for commits@pulsar.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@pulsar.apache.org