gdaws / stompit

STOMP client library for node.js
MIT License
163 stars 36 forks source link

Subscriber disconnects and does not recover #103

Open drorcohen001 opened 4 years ago

drorcohen001 commented 4 years ago

I'm using channel pool to connect to MQ, to listen for messages. When MQ has connection issues (I see them when it emits 'connecting' events on ConnectFailover), the subscriber disconnects from the MQ (I see '0 consumers' in the admin console) And when MQ recovers from the connection issues, there are times that the consumer does not recover. Is there a 'disconnect' event that I can listen to, to re-subscribe to the queue? Thanks

r1cebank commented 4 years ago

You can put the subscribing logic inside the manager.connect callback, it is called everytime the client is connected to the server

manager.connect((error, client, reconnect) => {
 // Cal some code to subscribe queues for that client
});