What is the best method to implement?
Something scalable. There is many, many possible solutions.
can akka using java language handle millions of users at the same time?
Yes, but most JMS and messaging solutions can handle this in theory. I would go with the one you feel you can use easiest.
concurrently?
These messaging solutions can't connect directly to end users, they only deal with messages actually sent. If you want to handle client connections I suggest a library like netty as well. It can handle 10,000 on one server comfortably. It can do more, but the server needs to have some room to do something useful as well.
Or there are different approach?
Too many to mention here.
I prefer using java, if anyone can just tell me the Technic i should use that uses java languge
You need to do some research yourself as to what tech you feel you can implement. Lots of tech could do it in theory, but the constraint is what can you do?
I suggest you use
- an app or web chat client
- which talks to a web service running netty or similar
- which talks to a messaging system for passing messages.
- most likely you will need to retain messages for a period of time, so add a scalable database on the back.