From 2a227d68c28ebdfb7b3ecc213ef72a0bd8d91932 Mon Sep 17 00:00:00 2001 From: joohyukkim Date: Tue, 9 May 2023 23:37:54 +0900 Subject: [PATCH 1/4] Add JavaDoc regarding PR #20242 --- .../src/main/java/org/apache/pulsar/client/api/Consumer.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Consumer.java b/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Consumer.java index 88ad24fe1f484..2a8f84b385c21 100644 --- a/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Consumer.java +++ b/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Consumer.java @@ -523,11 +523,15 @@ CompletableFuture reconsumeLaterCumulativeAsync(Message message, /** * The asynchronous version of {@link Consumer#seek(MessageId)}. + *

+ * If there is already a seek operation in progress, the method will log a warning and return a canceled future. */ CompletableFuture seekAsync(MessageId messageId); /** * Reset the subscription associated with this consumer to a specific message publish time. + *

+ * If there is already a seek operation in progress, the method will log a warning and return a canceled future. * * @param timestamp * the message publish time where to reposition the subscription From 2d0ed78b564caea5ae4694c86d7ddbb2118cb199 Mon Sep 17 00:00:00 2001 From: joohyukkim Date: Tue, 16 May 2023 05:40:55 +0900 Subject: [PATCH 2/4] Update JavaDoc to the latest behavior --- .../main/java/org/apache/pulsar/client/api/Consumer.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Consumer.java b/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Consumer.java index 2a8f84b385c21..5381003c95eec 100644 --- a/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Consumer.java +++ b/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Consumer.java @@ -524,14 +524,16 @@ CompletableFuture reconsumeLaterCumulativeAsync(Message message, /** * The asynchronous version of {@link Consumer#seek(MessageId)}. *

- * If there is already a seek operation in progress, the method will log a warning and return a canceled future. + * If there is already a seek operation in progress, the method will log a warning and + * return a future completed exceptionally. */ CompletableFuture seekAsync(MessageId messageId); /** * Reset the subscription associated with this consumer to a specific message publish time. *

- * If there is already a seek operation in progress, the method will log a warning and return a canceled future. + * If there is already a seek operation in progress, the method will log a warning and + * return a future completed exceptionally. * * @param timestamp * the message publish time where to reposition the subscription From 3673c25829b178d6832ab210f38cabd2c68454d4 Mon Sep 17 00:00:00 2001 From: joohyukkim Date: Tue, 16 May 2023 12:57:28 +0900 Subject: [PATCH 3/4] Add descriptions to seek methods also. --- .../java/org/apache/pulsar/client/api/Consumer.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Consumer.java b/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Consumer.java index 5381003c95eec..0a524228890ec 100644 --- a/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Consumer.java +++ b/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Consumer.java @@ -465,6 +465,9 @@ CompletableFuture reconsumeLaterCumulativeAsync(Message message, /** * Reset the subscription associated with this consumer to a specific message id. + *

+ * If there is already a seek operation in progress, the method will log a warning and + * return a future completed exceptionally. * *

The message id can either be a specific message or represent the first or last messages in the topic. *