pulsar-client-node
pulsar-client-node copied to clipboard
Event listener if client disconnect or connection interruption
It would be great to have a callback at Client level that trigger if connection break in-between.
@iamrmin If the connection is disconnected from the server side, the client will automatically reconnect and the application should not need to detect it. Could you tell me why you need such a callback?
@massakam ok but what if it takes hours and days to reconnect. Though I am not sure what is a timeout my concern here is healthcheck. It somehow should be know that pulsar is down and i am looking for any kind of callback.
@iamrmin On the producer side, we should be able to notice that the connection has been lost because message sending times out (the duration can be changed with the sendTimeoutMs
property) and an exception is thrown. On the consumer side, there is currently no way to notice that the connection has been lost except by looking at the error log.
The Node.js client is a wrapper of Pulsar C++ client and the C++ client doesn't have such feature. So it is currently difficult to implement such a callback...
@massakam I see. Thank you :)