我试图在基于java的客户端和服务器之间实现双向通信,主协议是JMS。但是由于客户端驻留的管理Intranet限制,因此无法进行入站连接。主要思想是将JMS包装成类似HTTP的东西。我选择了Websockets。我找到的唯一解决方案是OpenMQ
。它支持这一点。还有更好的解决方案吗?
感谢。
答案 0 :(得分:1)
JMS is a way different way of communication compared to websockets. Briefly :
So, JMS is a different approach to Websockets, since JMS is "stateless" and optionally asynchronous, while websockets are stateful and synchronous.
Thus, I think you should not make a choice between those 2, considering only the firewall limitation, but you should be more focused on the context of the 2 approaches, deciding which one is more suitable for your case.
If you believe that JMS is a better solution, then you should alter the firewall rules, so that the port used for JMS (by default 1099) is allowed with specific security limitations. Otherwise, you can use websockets, accepting the performance limitation of synchronous communication.
There is also the approach of integrating websockets with JMS, that is captured by openMQ and other frameworks. However, I do not know what the implications in performance will be compared to simple JMS, and I think that this solution should be chosen, only if we talk about a web application.
Additional Comment
There is also the capability of using HTTP tuneling over JMS. Thus, you will not have to use websockets. You will still use JMS, but there will be a servlet that will be receiving HTTP requests and redirecting them to the JMS service. This has also been implemented in openMQ, as you can see in the tutorial. In this way, you ovveride the firewall restriction, without adding the complexity of websockets.