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/09/26 04:51:05 UTC

[GitHub] [pulsar] lordcheng10 opened a new issue #12197: When the producer or client is normally closed, data will be lost

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

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



[GitHub] [pulsar] lordcheng10 commented on issue #12197: When the producer or client is normally closed, data will be lost

Posted by GitBox <gi...@apache.org>.
lordcheng10 commented on issue #12197:
URL: https://github.com/apache/pulsar/issues/12197#issuecomment-927231214


   I submitted a PR to fix:https://github.com/apache/pulsar/pull/12195


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



[GitHub] [pulsar] github-actions[bot] commented on issue #12197: When the producer or client is normally closed, data will be lost

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #12197:
URL: https://github.com/apache/pulsar/issues/12197#issuecomment-1054902621


   The issue had no activity for 30 days, mark with Stale label.


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



[GitHub] [pulsar] lordcheng10 closed issue #12197: When the producer or client is normally closed, data will be lost

Posted by GitBox <gi...@apache.org>.
lordcheng10 closed issue #12197:
URL: https://github.com/apache/pulsar/issues/12197


   


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