lordcheng10 opened a new issue #12197:
URL: https://github.com/apache/pulsar/issues/12197


   **Describe the bug**
   In the following example, the data will be lost:
   ` try {
   PulsarClient client = 
PulsarClient.builder().serviceUrl("pulsar://127.0.0.1:6650").build();
   
           Producer<byte[]> producer = 
client.newProducer().topic("test1").create();
   
           producer.sendAsync("hello".getBytes());
           client.close();
       } catch (PulsarClientException e) {
           e.printStackTrace();
       }
   
       Thread.sleep(1000);`
   The reason is because the producer did not send the data in the client 
buffer when it was closed;
   
   The correct approach is to first flush data when closing。
   


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