codelipenghui commented on code in PR #20139:
URL: https://github.com/apache/pulsar/pull/20139#discussion_r1171990404
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/TopicMessageIdImpl.java:
##########
@@ -18,15 +18,27 @@
*/
package org.apache.pulsar.client.impl;
+import java.util.BitSet;
import org.apache.pulsar.client.api.MessageId;
+import org.apache.pulsar.client.api.MessageIdAdv;
import org.apache.pulsar.client.api.TopicMessageId;
-public class TopicMessageIdImpl extends TopicMessageId.Impl {
+public class TopicMessageIdImpl implements MessageIdAdv, TopicMessageId {
- private final String topicName;
+ private final String ownerTopic;
+ private final MessageIdAdv msgId;
+ private final String topicName; // it's never used
+ public TopicMessageIdImpl(String topic, MessageIdAdv msgId) {
+ this.ownerTopic = topic;
+ this.msgId = msgId;
+ this.topicName = "";
+ }
Review Comment:
Nit:
Since we have a new constructor, the below one is deprecated.
We should use the new constructor in `MessageIdImpl#fromByteArrayWithTopic`
https://github.com/apache/pulsar/blob/6dc0b0ea38ab9dc410a24b19fd7567b9e013837d/pulsar-client/src/main/java/org/apache/pulsar/client/impl/MessageIdImpl.java#L144-L147
And if the challenge is the ownerTopic is different from topicName, we can
try to get the topicName from the ownerTopic(partition name)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]