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 2021/11/23 17:55:10 UTC

[GitHub] [pulsar] michaeljmarshall commented on a change in pull request #12946: Use sendAsync instead of send when produce message to retry topic.

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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org