Vanlightly commented on pull request #10279:
URL: https://github.com/apache/pulsar/pull/10279#issuecomment-893465622


   I have submitted a PR for lazy producers in the C++ client 
(https://github.com/apache/pulsar/pull/11570), I did the work before seeing 
this PIP-79. The approach I took was to create the producers without starting 
the lookup and connection procedure. So the collection of producers is as big 
as the number of partitions, and changes when the number partitions change, but 
the lookup and connect procedure is only started on a producer's first message. 
It does not block in sendAsync but kicks off the procedure asynchronously 
allowing messages to be buffered until the producer is connected. In the C++ 
client, deadlocks were an issue so I avoided any blocking code.
   
   I don't know if that approach makes sense for the Java client as I have not 
studied how the Java client works in detail yet. But that seems to be the main 
difference between my C++ changes and this Java client change.
   


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