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 2022/05/25 01:11:42 UTC

[GitHub] [pulsar] Technoboy- commented on a diff in pull request #15729: [improve][txn] Support ack message list for transaction

Technoboy- commented on code in PR #15729:
URL: https://github.com/apache/pulsar/pull/15729#discussion_r881106921


##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Consumer.java:
##########
@@ -491,13 +491,51 @@ CompletableFuture<Void> acknowledgeCumulativeAsync(MessageId messageId,
      */
     CompletableFuture<Void> acknowledgeAsync(Messages<?> messages);
 
+
+    /**
+     * Asynchronously acknowledge the consumption of {@link Messages}, it will store in pending ack.
+     * After the transaction commit, the message will actually ack.
+     * After the transaction abort, the message will be redelivered.
+     * @param messages
+     *            The {@link Messages} to be acknowledged
+     * @param txn {@link Transaction} The transaction to ack messages.
+     * @throws PulsarClientException.AlreadyClosedException
+     *             if the consumer was already closed
+     * @throws org.apache.pulsar.client.api.PulsarClientException.TransactionConflictException
+     *             if the ack with messageId is less than the messageId in pending ack state or ack with transaction is
+     *             different from the transaction in pending ack.
+     * @throws org.apache.pulsar.client.api.PulsarClientException.NotAllowedException
+     *             broker don't support transaction
+     * @return {@link CompletableFuture} the future of the ack result
+     * */
+    CompletableFuture<Void> acknowledgeAsync(Messages<?> messages, Transaction txn) throws PulsarClientException;
+

Review Comment:
   It's better not throw exception when using CompletableFuture as return type.



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