服务器调用客户端(EJB)
在我的项目中,我将业务逻辑实现为应用程序服务器上的 EJB 和桌面客户端(调用这些 EJB 的独立应用程序)。当我只有一侧通信(客户端 -> 服务器)时,一切工作正常,但现在我需要能够订阅/由服务器池化。所以基本上在客户端登录服务器后,服务器可以随时向其发送更新。由于我无法在应用程序服务器之外使用 EJB,所以问题是如何做到这一点(解决此类问题的标准和首选方法是什么)。也许我可以实现任何 JMS?(它在应用程序服务器之外如何工作..)
问候
In my project I have Business Logic implemented as EJB on Application Server and a desktop client - standalone application that calls those EJBs. Everything works fine when I have only one sided communication (client -> server) but now I need the possibility to subscribe / be pooled by server. So basically after client login into the server the server can send the update to it anytime. Since I cannot use EJB outside the Application server the question is how to do it (what's the standard and preffered way to solve such problems). Maybe I could any JMS implementation ?(how does it work outside application server..)
Regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
轮询将是一个简单的解决方案。它可能无法满足您在所有情况下的需求,因为它会增加服务器上的负载:
Polling would be a simple solution. It may not fit your needs in all situations as it increases load on the server:
JMS 实现在这里似乎是合适的,服务器发布消息并发送消息。客户端消费它。此外,由于通信是异步的,因此它将利用客户端和客户端。服务器资源优化。
轮询可能会降低性能,因为在许多情况下,可能不需要将其作为连续活动。您可以根据需要使用主题/队列机制,通过同步/异步通信。
JMS implementation seems appropriate here, the server publishes the message & client consumes it. Also as the communication will be asynchronous, it will utilize the client & server resources optimally.
Polling may reduce performance, as in many situations it may not be needed as a continuous activity. You can use topic/queue mechanism based on the requirements through synchronous/asynchronous communication.