You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "shibd (via GitHub)" <gi...@apache.org> on 2023/04/10 14:24:56 UTC

[GitHub] [pulsar] shibd commented on issue #18616: PIP-224: Introduce TopicMessageId for consumer's MessageId related APIs

shibd commented on issue #18616:
URL: https://github.com/apache/pulsar/issues/18616#issuecomment-1501882347

   > @BewareMyPower : serializing and deserializing is expensive and on top of that having different APIs for different use cases is creating a really bad experience for users, and I strongly feel we should avoid such APIs and complexity if things can be solved with a simple straight forward change with the same API and without creating the bad user experience. I think we should consider this simple change without costing performance and API incompatibility and confusing usage to the users. so, we should go with this obvious and straightforward change PR: #19944 as a lot of configurations and APIs are a huge pain point for Pulsar users already and I want to avoid doing it more and more in the Pulsar community.
   
   
   I think it is necessary to introduce `TopicMessageId` interface.
   
   If users know `topicName`, `ledgerId`, `entryId` and `partitionIndex` and if he would create MessageId to use acknowledge, It can be constructed in the following way:
   
   ```java
   MessageId topicMsgId = TopicMessageId.create(topicName, 
   
         DefaultImplementation.getDefaultImplementation().newMessageId(ledgerId, entryId, partitionIndex));
   
   consumer.acknowledge(topicMsgId);
   ```
   
   Without `TopicMessageId` interface, I'm not sure there is another way to construct it?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org