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/11/19 00:13:53 UTC

[GitHub] [pulsar] codelipenghui commented on a change in pull request #12872: [Broker] Support create subscription by specifying the earliest or latest position.

codelipenghui commented on a change in pull request #12872:
URL: https://github.com/apache/pulsar/pull/12872#discussion_r752770279



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java
##########
@@ -1318,9 +1318,9 @@ public void createSubscription(
             @ApiParam(value = "Is authentication required to perform this operation")
             @QueryParam("authoritative") @DefaultValue("false") boolean authoritative,
             @ApiParam(name = "messageId", value = "messageId where to create the subscription. "
-                    + "It can be 'latest', 'earliest' or (ledgerId:entryId)",
+                    + "It can be 'latest', 'earliest' or (ledgerId:entryId:partitionIndex)",
                     defaultValue = "latest",
-                    allowableValues = "latest, earliest, ledgerId:entryId"
+                    allowableValues = "latest, earliest, (ledgerId:entryId:partitionIndex)"

Review comment:
       We should use the `ResetCursorData` here, for couple reasons:
   
   1. In pulsar, the default behavior is to create the subscription on the latest position, so if users did not provide the messageId, it means creating a subscription by using the latest position.
   2. `isExcluded` and `batchIndex` should be also considered when creating a subscription.
   3. Follow the same API def with PersistentTopics.resetCursorOnPosition(), for passing the position information, we should provide a consistent way.




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