merlimat commented on a change in pull request #1553: Pulsar 2.0 docs
URL: https://github.com/apache/incubator-pulsar/pull/1553#discussion_r184607481
 
 

 ##########
 File path: site/docs/latest/clients/Java.md
 ##########
 @@ -155,15 +167,18 @@ When using {% popover partitioned topics %}, you can 
specify the routing mode wh
 
 ### Async send
 
-You can publish messages 
[asynchronously](../../getting-started/ConceptsAndArchitecture#send-modes) 
using the Java client. With async send, the producer will put the message in a 
blocking queue and return immediately. The client library will then send the 
message to the {% popover broker %} in the background. If the queue is full 
(max size configurable), the producer could be blocked or fail immediately when 
calling the API, depending on arguments passed to the producer.
+You can also publish messages 
[asynchronously](../../getting-started/ConceptsAndArchitecture#send-modes) 
using the Java client. With async send, the producer will put the message in a 
blocking queue and return immediately. The client library will then send the 
message to the {% popover broker %} in the background. If the queue is full 
(max size configurable), the producer could be blocked or fail immediately when 
calling the API, depending on arguments passed to the producer.
 
 Here's an example async send operation:
 
 ```java
 CompletableFuture<MessageId> future = 
producer.sendAsync("my-async-message".getBytes());
+future.thenAccept(msgId -> {
+        System.out.printf("Message with ID %s successfully sent", new 
String(msgId.toByteArray());
 
 Review comment:
   Should we have a `\n` at the end of string?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to