congbobo184 commented on code in PR #15729:
URL: https://github.com/apache/pulsar/pull/15729#discussion_r881413533
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerBase.java:
##########
@@ -492,11 +492,30 @@ public CompletableFuture<Void>
acknowledgeAsync(Messages<?> messages) {
return acknowledgeAsync(messageIds);
}
+ @Override
+ public CompletableFuture<Void> acknowledgeAsync(Messages<?> messages,
Transaction txn) {
+ List<MessageId> messageIds = new ArrayList<>(messages.size());
+ for (Message<?> message: messages) {
+ try {
+ validateMessageId(message);
+ } catch (PulsarClientException e) {
+ return FutureUtil.failedFuture(e);
+ }
+ messageIds.add(message.getMessageId());
+ }
+ return acknowledgeAsync(messageIds, txn);
+ }
+
@Override
public CompletableFuture<Void> acknowledgeAsync(List<MessageId>
messageIdList) {
return doAcknowledgeWithTxn(messageIdList, AckType.Individual,
Collections.emptyMap(), null);
}
+ @Override
+ public CompletableFuture<Void> acknowledgeAsync(List<MessageId>
messageIdList, Transaction txn) {
+ return doAcknowledgeWithTxn(messageIdList, AckType.Individual,
Collections.emptyMap(), (TransactionImpl) txn);
Review Comment:
should register the partition topic and doAckForResponse
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]