JMS与Web服务 [英] JMS vs Webservices

查看:87
本文介绍了JMS与Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

相对于Web服务,JMS的最大优势是什么?反之亦然?

What are the big advantages from JMS over Webservices or vice versa?

(Web服务是否膨胀?JMS总体上是否更好地提供了接口?)

(Are webservices bloated? Is JMS overall better for providing interfaces?)

推荐答案

从埃里克森改正后

JMS要求您具有JMS提供程序,实现用于处理消息的MessageListener接口的Java类以及知道如何连接到JMS队列的客户端. JMS意味着异步处理-客户端发送消息,而不必等待响应. JMS可以以点对点队列的方式使用或发布/订阅.

JMS requires that you have a JMS provider, a Java class that implements the MessageListener interface for processing messages, and a client that knows how to connect to the JMS queue. JMS means asynchronous processing - the client sends the message and doesn't necessarily wait for a response. JMS can be used in a point-to-point queue fashion or publish/subscribe.

服务"是一个流动性术语.我认为服务是可以在网络上生存并发布合同的组件:如果您给我发送X,我将为您执行此任务并返回Y."

"Service" is a fluid term. I think of a service as a component that lives out on a network and advertises a contract: "If you send me X I'll perform this task for you and return Y."

分布式组件已经存在很长时间了.每个人使用不同的协议(例如COM,Corba,RMI等)进行通信,并以不同的方式公开其合同.

Distributed components have been around for a long time. Each one communicated using a different protocol (e.g., COM, Corba, RMI, etc.) and exposed their contract in different ways.

Web服务是分布式服务的最新趋势.他们使用HTTP作为协议,并且可以与任何可以通过TCP/IP连接并发出HTTP请求的客户端进行互操作.

Web services are the latest trend in distributed services. They use HTTP as their protocol and can interoperate with any client that can connect via TCP/IP and make an HTTP request.

您可以使用SOAP或RPC-XML或REST或契约优先"样式,但是使用HTTP作为其协议的分布式组件的基本思想仍然存在.

You can use SOAP or RPC-XML or REST or "contract first" styles, but the underlying idea of a distributed component using HTTP as its protocol remains.

如果您接受所有这些,则Web服务通常是同步调用.它们不必be肿,但您可以使用任何样式或语言编写不良组件.

If you accept all this, web services are usually synchronous calls. They need not be bloated, but you can write bad components in any style or language.

您可以通过先设计请求和响应来开始设计任何分布式组件.有了这些,您就可以根据要拥有的客户端类型以及通信是同步还是异步来选择JMS或Web服务.

You can start designing any distributed component by designing the request and responses first. Given those, you choose JMS or web services based on what kind of clients you want to have and whether or not the communication is synchronous or asynchronous.

这篇关于JMS与Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆