使用Java EE实现聊天应用程序

问题描述:

我使用Java EE框架EJB 3开发了我的Web应用程序。
现在我计划在我的网络应用程序中添加聊天工具。所有在线用户都可以互相聊天。

I have developed my web application by using Java EE framework EJB 3, at front using JSF. Now I plan to add chat tool to my web application. All online users can chat with each other.

您能否指导我使用哪种工具将其与Java EE集成以开发我的聊天应用程序?如果您提供代码或任何链接,我也很感激。

Can you please guide me which tool I should use to Integrate it with Java EE to develop my chat application? I also appreciate if you provide code or any link.

1-您必须安装预先开发的聊天服务器。有很多可用的解决方案我建议您选择Ejabberd( http://www.ejabberd.im/ )。它是使用Erlang实现的聊天服务器,被视为高度可扩展的服务器。它与Facebook聊天服务器相同,请注意,Facebook在开始时只使用一台服务器来处理全世界的所有聊天流量。

1- You have to install a pre developed Chat server. There is many available solutions I advice you to choose Ejabberd ( http://www.ejabberd.im/ ). It's a chat server implemented using Erlang and is considered as a highly scalable server. It's the same as facebook chat server, note that facebook used at the beginning only one server to handle all its chat traffic all over the world.

2-您必须集成一个将与聊天服务器通信的js聊天客户端。还有一个很酷的开源解决方案叫做ijab( http://code.google.com/p / ijab / )。您只需将其配置为与服务器连接。

2- You have to integrate a js chat client that will communicate with the chat server. There is also a cool open source solution for that called ijab ( http://code.google.com/p/ijab/ ). You have just to configure it to connect with your server.

3-要添加好友并管理用户之间的交互,您可以使用java jabber库,其中有很多。该库将用于连接ejabberd服务器。您可以选择其中一个Java客户端,但有很多。

3- To add friends and manage interactions between users, you can use a java jabber library and there are many. This library will be used to connect to ejabberd server. You can choose one of the java clients but there are many.

您在聊天配置中会遇到很多问题,所以不要估计它

You'll encounter many problems in the configuration of chat so don't under estimate it