yosiat commented on issue #78: Error: Failed to send message: AlreadyClosed 
URL: 
https://github.com/apache/pulsar-client-node/issues/78#issuecomment-602585875
 
 
   Hey!
   
   I see you what you are writing here, but this is a bug in the client.
   I don't need to implement any keepalives or ping-pong mechanism on my own.
   
   Here is the go client, doing the same thing I did with my nodejs example 
(https://github.com/apache/pulsar-client-node/issues/78#issuecomment-601153727) 
- https://gist.github.com/yosiat/97460fb4dee41c5d0d0f6873a31c77d9
   
   The go code is producing all messages, while the node client is dying after 
some time.
   
   the problem in my opinion that my function is maintaining a reference to the 
producer but no to the client which cause NodeJS/V8 to garage collect the 
client since it's not being referenced.
   Changing my code to, instead of `console.log(`Sent message: ${msg}`);`  to 
`console.log(`Sent message: ${msg} - client ${client}`);` fixes the issue for 
me.
   IMO, But this is wrong.
   
   
   @eaba my example has only one client and one producer.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to