How to create xmpp user session without socket connection?


I’m developing web based social networking service. One of my core server components will be openfire server. The motivation to use it is that it already contains roster, presence, messaging, iq functionalities I need so I save my programmer resources. The other, more important motivation is that I plan to converge web based functionalities with instant messaging functionalities that’s why I need openfire.

At the first glance, the simpliest way to integrate it is to use client smack library as a client api to access openfire functionalities.

It would work like this:

  • my user logs into my web based social networking service
  • user management is based on openfire so web service core creates XMPPConnection then invokes login method in order to create user session

My problem is that every unique client login creates separate socket connection - so if I have 2K users logged in it would cause 2K socket connections.

So my question is as following:

Is there other way, less resource consuming to create user session without need of creating every single low level socket connection?

My dreamed-of solution would be creating ONE socket server/component connection and handle all user management operations via this connection.

If something is not clear, ask me then I will precise.

Thanks for help in advance !!


Hi Jan,

you may want to take a look at the Connection Manager code. It uses 5 connections to connect to Openfire as a proxy for a random number of users.