Project

General

Profile

chating use bosh in cluster mode

hurry wang
Added about 2 years ago

Hi,

I am facing a problem, I use Haproxy to reverse proxy to nodes of tigase cluster(use roundrobin mode) ,and use bosh client to chat with someone. The problem is ,one side can send message,but the other side can not recive message at all, but I stopped one of the nodes,it could work correctly .I wondered that ,it would be session problem,the two nodes did not synchronize the session .How can I solve it? Thank you.


Replies (3)

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam about 2 years ago

In case of a BOSH, many HTTP connections are used and to make it work properly with Tigase XMPP Server all requests for same session needs to be pointed (ie. by load balancer) to same Tigase XMPP Server cluster node.

Added by hurry wang about 2 years ago

Hi,

If I use DNS to proxy two nodes ,how can I ensure all requests for same session to be point to the same node?

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam about 2 years ago

This is a tricky thing. In our Jaxmpp client and Tigase XMPP Server we implemented mechanism which reports to client full name of cluster node to which client got connected and for following BOSH requests client connects directly to this cluster node using it's name.

However if you use BOSH for connections from web browser, I would strongly suggest to use WebSocket instead of BOSH as a WebSocket is usually faster than BOSH and additionally there is a single HTTP connection, so there is no need to route many HTTP connections to the same Tigase XMPP Server cluster node.

    (1-3/3)