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/06/08 11:20:17 UTC

[GitHub] [pulsar] lhotari commented on issue #10832: [Question] Can producer send() cause cumulative ACK from previous sendAsync()?

lhotari commented on issue #10832:
URL: https://github.com/apache/pulsar/issues/10832#issuecomment-856677788


   I believe that the Producer [flush](https://pulsar.apache.org/api/client/2.7.0-SNAPSHOT/) and [flushAsync](https://pulsar.apache.org/api/client/2.7.0-SNAPSHOT/org/apache/pulsar/client/api/Producer.html#flushAsync--) methods exist for the use case that you have described.
   
   When using the async API one must ensure the CompletableFutures returned from `sendAsync` are handled for the case of errors since the call to `flushAsync` will be successful also in the case that one of the messages fails.
   
   Another challenge is the producer flow control (back pressure). By default the future returned from sendAsync will complete with an exception when the producer queue is full. It's possible to change this behavior in the producer settings in the `ProducerBuilder` with `.blockIfQueueFull(true)`, but this has a downside of making sendAsync a blocking operation. 


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

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