The internet is full of "Simple chat app" tutorials "pub/sub" systems with channels, that teaches to build public chat with all existing technologies and programming languages. I did not succeed in finding a solution for private one to one messaging service between logged in users. Let's say I have an existing Rails Twitter clone app, the authentication implemented with built in rails tools. Now I want to add a new feature, a private instant messaging system between users. It may be implemented with redis/node/socketio, rabbitmq, ejabberd and what ever. The only element I do not understand is how to make this chat one-to-one. Should I open a new channel for every pair of users? I'm looking for a global picture, not a step by step solution. Thanks
Asked
Active
Viewed 280 times
0
-
Have you looked at [stomp over websocket](http://jmesnil.net/stomp-websocket/doc/)? The answer largely depends on how many concurrent users you will have and if you want to store the messages. On my opinion, yes, a new channel/queue/subscription should be created. User A spawns a one to one conversation with user B, a new secret queue is created. The difficult part may reside in the protocol. – Nicolas Labrot Apr 07 '15 at 09:47
-
@NicolasLabrot Let's say i have 3000 active users. So it will be something like 3000!(operand) channels? – Ilya Libin Apr 07 '15 at 09:58
-
3000 channels will not be an issue. You could have a look too at the following answer [What instant messaging system would you use, to extend a website with a secure 1:1 chat with their customer services representative?](http://stackoverflow.com/questions/3960786/what-instant-messaging-system-would-you-use-to-extend-a-website-with-a-secure-1?rq=1) – Nicolas Labrot Apr 07 '15 at 12:46