简体   繁体   English

Web服务与消息传递

[英]Web Services vs Messaging

What kind of arguments one should use when choosing between integration using web service vs JMS? 在使用Web服务与JMS进行集成时,应该使用哪种参数? I'm familiar with basics of both approaches however in some cases it is unclear as to which one would be the best for a given situation. 我熟悉这两种方法的基础知识,但在某些情况下,不清楚哪一种方法对于特定情况最好。 I guess I'm looking for a high overview comparison with use cases. 我想我正在寻找与用例的高概述比较。

thanks 谢谢

JMS is a messaging service. JMS是一种消息传递服务。 It is asynchronous and 2 directional, ie you can write application that both sends and receives messages. 它是异步的和2方向的,即您可以编写既发送又接收消息的应用程序。 But this must be application implemented typically in java. 但这必须是通常在java中实现的应用程序。 I mean it cannot be thin client. 我的意思是它不能瘦客户端。 And standard protocol of JMS is TCP based, so it may be blocked by firewall. 并且JMS的标准协议是基于TCP的,因此它可能被防火墙阻止。

Web service is designed as a transport over HTTP, so it typically passes firewalls. Web服务被设计为通过HTTP传输,因此它通常会传递防火墙。 But it is one directional: client calls server; 但它是一个方向:客户端调用服务器; server cannot call client. 服务器无法调用客户端。 It just can response client's calls. 它只能响应客户的电话。 Client of web service (especially RestFull web service) is very simple, so it can be easily implemented as a thin client (eg AJAX client). Web服务的客户端(尤其是RestFull Web服务)非常简单,因此可以轻松实现为瘦客户端(例如AJAX客户端)。

Good question. 好问题。

I will use Web Service when: 我会在以下情况下使用Web Service
1. Dealing with cross domains, typically services environment when I am not sure about the client technology. 1.当我不确定客户端技术时,处理跨域,通常是服务环境。
2. Need Synchronous response. 2.需要同步响应。

And pickup Messaging when (Hope you mean Messaging not just Java version): 拾取消息时(希望你的意思是消息不仅仅是Java版本):
1. Need Asynchronous request/response. 1.需要异步请求/响应。
2. High Availability. 2.高可用性。
3. Confirmed Delivery. 3.确认交货。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM