h.xn
h.xn

Reputation: 25

How to get unique pulsar message id in different case

interface: MessageId impl: MessageIdImpl BatchMessageIdImpl RawMessageIdImpl

The implement have different properties, different toString() method, that confused me much.

Upvotes: 0

Views: 1177

Answers (1)

Lanayx
Lanayx

Reputation: 2876

You should always be using message id through the interface, it supports comparison between different implementation. toString method should only be used for logging purpose. If you need to save it somewhere and restore later you need to use toByteArray and fromByteArray methods.

Upvotes: 1

Related Questions