BewareMyPower commented on issue #63:
URL: 
https://github.com/apache/pulsar-client-cpp/issues/63#issuecomment-1305862187

   It's an incorrect use to call a synchronous API in the callback of an 
asynchronous API.
   
   For example, the following Java code also causes the deadlock.
   
   ```java
           @Cleanup final var client = PulsarClient.builder()
                   .serviceUrl(Config.BROKER_URL)
                   .build();
           @Cleanup final var producer = client.newProducer(Schema.STRING)
                   .topic("my-topic")
                   .create();
           producer.sendAsync("hello").thenAccept(msgId -> {
               try {
                   producer.close();
                   System.out.println("Producer closed");
               } catch (PulsarClientException e) {
                   throw new RuntimeException(e);
               }
           }).get();
   ```


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