Last active
August 29, 2015 14:13
-
-
Save storkme/43dec2d73bef5d804375 to your computer and use it in GitHub Desktop.
Description of a workaround for reconnects in node-stomp-client
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Stomp = require('stomp-client'); | |
var client = new Stomp(host, port, user, password, '1.1', vhost); | |
client.connect(onConnect, onError); | |
function onConnect(sessId) { | |
//subscribe to queues etc | |
} | |
function onError(err) { | |
if (err.code === 'ECONNRESET') { | |
client.subscriptions = {}; | |
client._stompFrameEmitter.removeAllListeners(); | |
client.connect(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment