I have a chat application in java using nio it’s working fine now. I want to split my chatserver into 2 with the same portno.
Simply :
- I want to Split single my server into two or three. When client
logins, it first connect to the first server. - When the first server have 10 clients then 11 th client must
connected to the Second server. and same mechanism for third
server. - These three server must have same port no.
- These server must have an internal communication. If client 1 is
logged into the server 1 . Any details got in server 1 should be
known by Server 2 and Server 3. - A client in server 1 must have to communicate with clients which
are in server 2 and server 3.
How can I make these possible is there any example related to this. I googled it but couldn’t find any appropriate solutions.
please guide me to resolve these.
Thank you very much.
You can use load balancer which redirects request as per server instance health, you can expose server health parameter by no. of connections that server have. for inter server communication i recommend to use apache activemq and shared database is also good idea