mattisonchao opened a new pull request #14947:
URL: https://github.com/apache/pulsar/pull/14947
### Motivation
As the code is shown below, If the ``doAcknowledge``throws exception, the
``result`` future can't complete.
```java
typedMessageBuilderNew.sendAsync()
.thenAccept(__ -> doAcknowledge(finalMessageId, ackType,
Collections.emptyMap(), null)
.thenAccept(v -> result.complete(null)))
.exceptionally(ex -> {
result.completeExceptionally(ex);
return null;
});
```
### Modifications
- Use ``thenCompose`` to instead of ``thenAccept``.
### Verifying this change
- [x] Make sure that the change passes the CI checks.
### Documentation
- [x] `no-need-doc`
--
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]