Closed amri closed 7 years ago
I reset my connection onError (via the options) then hook my subscription back up. It works fine, but I would also like the ability to have this lib do that for me.
Feel free to submit a pull request to implement support for this. All contributions are gratefully received.
@coreyperkins how do you reconnect onError ?
@amri In my options I define the onError handler like so.
var sourceOptions = {
host: sourceConfig.eventStore.address,
port: sourceConfig.eventStore.port,
debug: sourceConfig.debug,
credentials: sourceConfig.eventStore.credentials,
streamId: sourceConfig.eventStore.stream,
onError: function(err) {
console.error('There was an error connecting to the source es!');
console.error(err);
console.error(err.stack);
subscribe();
}
};
Then in the subscribe function I simply make a call to connection.subscribeToStreamFrom providing the last check point I successfully got to.
Enjoy!
Hi,
I've been investigating issue where my js code intermittenly stop pushing event to eventstore. Once I put some logging i found these:
I found in .NET client library have the functionality:
Is there a workaround for this issue ? or should I reconnect when onError / onClosed event called ?