Closed lboynton closed 12 years ago
Is the project on Google Groups or somewhere similar where I could discuss this?
@lboynton you can discuss it right here!
OK, is there a way of updating node-xmpp-bosh without having to restart it? I did look at how to gracefully restart nodejs applications but I'm not familiar enough with nodejs to know if/how it can be applied to node-xmpp-bosh.
@lboynton I'm afraid that there is no way of doing that currently. Every application that needs to support this feature would have to code for it. It isn't something one would get for free by writing code in node.js.
The problem is that:
Is there any specific reason you asked for this feature? Maybe there is another solution to it - just curious. I'm asking since we did think about this when we started the project, but decided against it since it would be quite painful to support and weren't sure how much of a value add it would be.
I'd like to be able to update the BOSH servers without disconnecting any users in cases where there are bug/security fixes or if I want to add in some extra logging for example. I saw Forever and some other examples (like http://codegremlins.com/) which could be used for graceful restarts of nodejs applications, but can these be used with node-xmpp-bosh?
Could two instances run simultaneously, the older version serving existing sessions and the newer version serving new sessions?
The method shown in the link above is interesting. They rely on an out-of-process service (redis in this case) to store data. If something like this needs to be done for NXB, then the session and stream data (and complete stream state) would have to be stored in redis (or some other out of process store).
It is definitely doable in theory (and in practice), but would need a significant re-write of the code base.
Another issue that NXB would face is maintaining the persistent connection with the backend XMPP server. That would also have to be extracted into a separate service, since once a connection to the xmpp server is lost, the client needs to re-authenticate.
If redis was used to store the state, would it be possible to add and remove BOSH servers from the load balancing pool (I'm currently using nginx with the sticky module but this doesn't allow me to remove a BOSH server) without dropping existing sessions? If so, this would be an added benefit of this approach. However I agree that this is quite a complex issue.
Anyway, I wanted to know if it was possible with NXB as it is currently and you have answered my question, thanks!
This isn't a bug but more of a feature request/question. Is it possible to update node-xmpp-bosh on the fly without having to restart it?