You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/06/27 14:27:23 UTC

[GitHub] [beam] mosche commented on a diff in pull request #22026: pulsar connector produces message asynchronously

mosche commented on code in PR #22026:
URL: https://github.com/apache/beam/pull/22026#discussion_r907453720


##########
sdks/java/io/pulsar/src/main/java/org/apache/beam/sdk/io/pulsar/WriteToPulsarDoFn.java:
##########
@@ -45,12 +54,48 @@ public void setup() throws PulsarClientException {
 
   @ProcessElement
   public void processElement(@Element byte[] messageToSend) throws Exception {
-    producer.send(messageToSend);
+    producer.sendAsync(messageToSend)

Review Comment:
   I agree with the concerns here, I've seen very troublesome async writers in Beam that were prone to loosing data. I suppose in this case it depends on the behavior of `producer.flush()` in `finishBundle()`. Does it block until all pending messages are send? If so, I'd suggest to add some comments to clarify.



-- 
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: github-unsubscribe@beam.apache.org

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