michaeljmarshall commented on a change in pull request #12946:
URL: https://github.com/apache/pulsar/pull/12946#discussion_r755378128



##########
File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java
##########
@@ -624,8 +624,8 @@ public UnAckedMessageTracker getUnAckedMessageTracker() {
                     if (message.hasKey()) {
                         typedMessageBuilderNew.key(message.getKey());
                     }
-                    typedMessageBuilderNew.send();
-                    return doAcknowledge(messageId, ackType, properties, null);
+                    return typedMessageBuilderNew.sendAsync().thenAccept(__ ->

Review comment:
       +1. Can we collapse the logic for this conditional? Once both branches 
use `sendAsync`, they'll have a common future of type 
`CompletableFuture<MessageId>` and both call `doAcknowledge` in the callback. 
That will also collapse the exception handling logic.




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


Reply via email to