equanz opened a new issue, #51: URL: https://github.com/apache/pulsar-client-cpp/issues/51
### Search before asking - [X] I searched in the [issues](https://github.com/apache/pulsar-client-cpp/issues) and found nothing similar. ### Version main( https://github.com/apache/pulsar-client-cpp/commit/ba1a7e1c28ab186ed1d51b5cab47334cca1b2aea ) ### Minimal reproduce step 1. Create a producer with `batchingEnabled=false` 2. Send some messages asynchronously 3. Call `Producer#flush` or `Producer#flushAsync` 4. (Close a producer) - to get AlreadyClosed exception https://github.com/apache/pulsar-client-cpp/blob/ba1a7e1c28ab186ed1d51b5cab47334cca1b2aea/lib/ProducerImpl.cc#L665-L666 ### What did you expect to see? When `Producer#flush` or `Producer#flushAsync` is called, wait for the completion of sending messages, even if non-batched messages. ### What did you see instead? `Producer#flush` and `Producer#flushAsync` don't guarantee the completion of sending non-batched messages. ### Anything else? Currently, `ProducerImpl#flushAsync` do nothing if `batchMessageContainer_` is not initialized. https://github.com/apache/pulsar-client-cpp/blob/ba1a7e1c28ab186ed1d51b5cab47334cca1b2aea/lib/ProducerImpl.cc#L331-L333 In Java client, wait last sent messages. We should implement C++ client like it. https://github.com/apache/pulsar/pull/2103 ### Are you willing to submit a PR? - [X] I'm willing to submit a PR! -- 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]
