BewareMyPower commented on code in PR #21873:
URL: https://github.com/apache/pulsar/pull/21873#discussion_r1449875807


##########
pip/pip-330.md:
##########
@@ -0,0 +1,43 @@
+# PIP-330: getMessageById gets all messages
+
+# Motivation
+
+The `org.apache.pulsar.client.admin.Topics` provides 
`getMessageById(java.lang.String, long, long)` method to get the
+message, which returns one message. If the message id refers to a batch 
message, we only can get the first message, not
+all messages.
+
+This behavior affects our analysis of messages by the message id.
+
+# Goals
+
+## In Scope
+
+Add a method that returns all messages by message id to the 
`org.apache.pulsar.client.admin.Topics` interface.
+
+# Detailed Design
+
+## Design & Implementation Details
+
+Add `getMessageById(java.lang.String, java.lang.String)` to 
`org.apache.pulsar.client.admin.Topics` interface:
+
+```java
+public interface Topics {
+    List<Message<byte[]>> getMessageById(String topic, String messageId) 
throws PulsarAdminException;

Review Comment:
   HI, @nodece, my original motivation is that we should hide the internals 
like ledger id. However, as an administrator, he/she has to know these details 
anyway. Even if we provide an API that accepts a string, it must be documented 
to include some fields as well, no matter it's a JSON (`{"ledger": 10, "entry": 
20}` or a comma-separated string (`10:20`).
   
   So I agree with @asafm's suggestion that we should not use the string 
parameter.
   
   And I also agree with you that the original API should be deprecated. 
Getting only 1 message looks strange.



-- 
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]

Reply via email to