You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/08/31 04:07:55 UTC

[GitHub] [pulsar] gaoran10 commented on a change in pull request #11852: [Issue 11814] fix pulsar admin method:getMessageById.

gaoran10 commented on a change in pull request #11852:
URL: https://github.com/apache/pulsar/pull/11852#discussion_r698966718



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
##########
@@ -2300,6 +2300,12 @@ protected void internalGetMessageById(AsyncResponse asyncResponse, long ledgerId
             }
             PersistentTopic topic = (PersistentTopic) getTopicReference(topicName);
             ManagedLedgerImpl ledger = (ManagedLedgerImpl) topic.getManagedLedger();
+            if (null == ledger.getLedgerInfo(ledgerId).get()) {
+                log.error("[{}] Failed to get message with ledgerId {} entryId {} from {}, "
+                                + "ledgerId not belong to this topic.",
+                        clientAppId(), ledgerId, entryId, topicName);
+                asyncResponse.resume(new RestException(Status.NOT_FOUND, "Message not found"));

Review comment:
       It seems that the response message is not clear, the message with a specific position does not exist or the ledger does not belong to this topic?




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