Hi Yunze,

Thanks for your proposal. Quoted from your GitHub comments[0]:

> There is also a case when MessageId is returned from Producer#send. In this 
> case, the returned MessageId should only used for serialization

Is there a case where the user uses the messageId returned by the
producer to seek in the consumer? Is this a good behavior?

> If we added the method directly to MessageId, to keep the backward 
> compatibility, the implementation of getTopicName() must return null, which 
> is not a good design.

I think it's a trade-off. If I understand correctly, even with the
current proposal, it may return null when getting the topic from
TopicMessageId for backward compatibility. The current
TopicMessageIdImpl doesn't serialize the topic information.


[0] https://github.com/apache/pulsar/issues/18616#issuecomment-1328609346

Thanks,
Zike Yang

On Mon, Nov 28, 2022 at 12:22 PM Yunze Xu <y...@streamnative.io.invalid> wrote:
>
> Hi all,
>
> I've opened a PIP to discuss: https://github.com/apache/pulsar/issues/18616.
>
> The consumer's MessageId related APIs have some hidden requirements
> and flakiness and some behaviors are not documented well. This
> proposal will introduce a TopicMessageId interface that exposes a
> method to get a message's owner topic.
>
> P.S. There was an email [1] that didn't add the "[DISCUSS]" label,
> which might be a little confusing. So I sent the email again for
> discussion. Please do not reply to the previous email.
>
> [1] https://lists.apache.org/thread/6gj16pmrjk6ncsd30xrl20pr5ng6t61o
>
> Thanks,
> Yunze

Reply via email to