How to get unique pulsar message id in different case

952 views Asked by At

interface: MessageId impl: MessageIdImpl BatchMessageIdImpl RawMessageIdImpl

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

1

There are 1 answers

2
Lanayx On BEST ANSWER

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.