You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by zh...@apache.org on 2020/05/12 13:44:59 UTC
[pulsar] 08/17: [Docs] Fix the Create subscribtion swagger of
PersistentTopic (#6776)
This is an automated email from the ASF dual-hosted git repository.
zhaijia pushed a commit to branch branch-2.5
in repository https://gitbox.apache.org/repos/asf/pulsar.git
commit be913edefa37b77ecf5780caebc9873de34d7b30
Author: 冉小龙 <rx...@apache.org>
AuthorDate: Tue May 12 12:10:50 2020 +0800
[Docs] Fix the Create subscribtion swagger of PersistentTopic (#6776)
* [Docs] Fix the Create subscribtion swagger of PersistentTopic
Signed-off-by: xiaolong.ran <rx...@apache.org>
* fix a little
Signed-off-by: xiaolong.ran <rx...@apache.org>
* fix a little
Signed-off-by: xiaolong.ran <rx...@apache.org>
* fix comments
Signed-off-by: xiaolong.ran <rx...@apache.org>
* fix comments
Signed-off-by: xiaolong.ran <rx...@apache.org>
* fix comments
Signed-off-by: xiaolong.ran <rx...@apache.org>(cherry picked from commit ce29135cfa15d9f20477a137c497848320f1b737)
---
.../org/apache/pulsar/broker/admin/v1/PersistentTopics.java | 5 +++--
.../org/apache/pulsar/broker/admin/v2/PersistentTopics.java | 13 ++++++++-----
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v1/PersistentTopics.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v1/PersistentTopics.java
index fbe378e..027e7bb 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v1/PersistentTopics.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v1/PersistentTopics.java
@@ -470,8 +470,9 @@ public class PersistentTopics extends PersistentTopicsBase {
@PUT
@Path("/{property}/{cluster}/{namespace}/{topic}/subscription/{subscriptionName}")
- @ApiOperation(value = "Reset subscription to message position closest to given position.", notes = "Creates a subscription on the topic at the specified message id")
- @ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission"),
+ @ApiOperation(value = "Create a subscription on the topic.", notes = "Creates a subscription on the topic at the specified message id")
+ @ApiResponses(value = {
+ @ApiResponse(code = 403, message = "Don't have admin permission"),
@ApiResponse(code = 404, message = "Topic/Subscription does not exist"),
@ApiResponse(code = 405, message = "Not supported for partitioned topics") })
public void createSubscription(@Suspended final AsyncResponse asyncResponse, @PathParam("property") String property,
diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java
index b7b780b..6f187ff 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java
@@ -752,7 +752,7 @@ public class PersistentTopics extends PersistentTopicsBase {
@PUT
@Path("/{tenant}/{namespace}/{topic}/subscription/{subscriptionName}")
- @ApiOperation(value = "Reset subscription to message position closest to given position.", notes = "Creates a subscription on the topic at the specified message id")
+ @ApiOperation(value = "Create a subscription on the topic.", notes = "Creates a subscription on the topic at the specified message id")
@ApiResponses(value = {
@ApiResponse(code = 401, message = "Don't have permission to administrate resources on this tenant or" +
"subscriber is not authorized to access this operation"),
@@ -771,14 +771,17 @@ public class PersistentTopics extends PersistentTopicsBase {
@PathParam("topic") @Encoded String topic,
@ApiParam(value = "Subscription to create position on", required = true)
@PathParam("subscriptionName") String encodedSubName,
- @ApiParam(value = "messageId where to create the subscription. " +
+ @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)",
defaultValue = "latest",
allowableValues = "latest,earliest,ledgerId:entryId"
)
- @QueryParam("authoritative") @DefaultValue("false") boolean authoritative, MessageIdImpl messageId,
- @ApiParam(value = "Is authentication required to perform this operation")
- @QueryParam("replicated") boolean replicated) {
+ MessageIdImpl messageId,
+ @ApiParam(value = "Is replicated required to perform this operation")
+ @QueryParam("replicated") boolean replicated
+ ) {
try {
validateTopicName(tenant, namespace, topic);
internalCreateSubscription(asyncResponse, decode(encodedSubName), messageId, authoritative, replicated);