node-nats-streaming-buffered-client
Advanced tools
Comparing version 1.3.3 to 1.3.4
@@ -322,5 +322,20 @@ "use strict"; | ||
_this.buffer.unshift(pub_1); | ||
// Trigger a reconnect to reset the connection and begin processing again | ||
if (error && error.message === 'stan: publish ack timeout') { | ||
_this.logger.warn('[NATS-BUFFERED-CLIENT] Publish time-out detected', error); | ||
} | ||
// A long term disconnect can trigger a bigger issue | ||
// The NATS connection might reconnect/resume but the streaming server | ||
// may have lost your client id or considers it dead due to missing heartbeats | ||
// An error called 'stan: invalid publish request' will occur in this case | ||
// If that happens we will manually reconnect to try and restore communication | ||
// | ||
// this.reconnect(); | ||
if (error && error.message === 'stan: invalid publish request') { | ||
_this.reconnect() | ||
.then(function () { | ||
_this.logger.warn('[NATS-BUFFERED-CLIENT] Completed forced reconnect due to client de-sync', error); | ||
}) | ||
.catch(function (reconnectError) { | ||
_this.logger.error('[NATS-BUFFERED-CLIENT] Reconnect failed', reconnectError); | ||
}); | ||
} | ||
} | ||
@@ -327,0 +342,0 @@ else { |
{ | ||
"name": "node-nats-streaming-buffered-client", | ||
"version": "1.3.3", | ||
"version": "1.3.4", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
Sorry, the diff of this file is not supported yet
32976
490