RobertIndie opened a new pull request #12872: URL: https://github.com/apache/pulsar/pull/12872
Fixes #9441 ### Motivation Currently, if we need to specify the messageID when creating a subscription through the REST API, we cannot use `latest` and `earliest` to specify the position. Instead, we can only do it like this to create a subscription from the latest position: ``` PUT /admin/v2/persistent/public/default/test/subscription/test HTTP/1.1 Content-Type: application/json {"ledgerId":9223372036854775807,"entryId":9223372036854775807,"partitionIndex":-1} ``` This PR adds support for creating subscription by specifying the `latest` or `earliest` position. So we can send the request like this: ``` PUT /admin/v2/persistent/public/default/test/subscription/test HTTP/1.1 Content-Type: application/json "latest" ``` ### Modifications * Add a private constructor for MessageIdImpl so that we can convert the string parameter like `latest` or `earliest` to the MessageIdImpl. ### Verifying this change This change is already covered by existing tests, such as *createSubscriptionBySpecifyingStringPosition*. ### Does this pull request potentially affect one of the following parts: *If `yes` was chosen, please highlight the changes* - Dependencies (does it add or upgrade a dependency): (no) - The public API: (no) - The schema: (no) - The default values of configurations: (no) - The wire protocol: (no) - The rest endpoints: (yes) - The admin cli options: (no) - Anything that affects deployment: (no) ### Documentation Check the box below and label this PR (if you have committer privilege). Need to update docs? - [x] `doc` (If this PR contains doc changes) -- 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-unsubscr...@pulsar.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org