java 架构师迫切希望在 JMS 上使用 SOAP

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2629366/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-29 22:06:18  来源:igfitidea点击:

Architect desperately wants to use SOAP over JMS

javasoapweb-servicesjmssoa

提问by Aerosteak

I have used JMS in the past to build application and it works great. Now I work with Architects that would love to use the Spec : SOAP over Java Message Service 1.0.

我过去曾使用 JMS 构建应用程序,并且效果很好。现在,我与喜欢使用规范:SOAP over Java Message Service 1.0 的架构师一起工作。

This spec seams overly complicated. I do not see many implementation (Beside the vendors pushing for the spec).

这个规范接缝过于复杂。我没有看到很多实现(除了推动规范的供应商)。

Does anyone here is using this specification in a production environment? What is your main benefit of using this spec?

这里有人在生产环境中使用这个规范吗?使用此规范的主要好处是什么?

Link: http://www.w3.org/TR/2009/CR-soapjms-20090604/

链接:http: //www.w3.org/TR/2009/CR-soapjms-20090604/

回答by Miklos Csuka

I had the bad luck using SOAP over JMS. It does make some sense, if it is used for fire-and-forget operations (no response message defined in the WSDL). In this case you can use the WSDL to generate client skeletons and you can store the WSDL in your service registry. Plus you get all the usual benefits of JMS (decoupling sender and receiver, load-balancing, prioritising, security, bridging to multiple destinations - e.g. non-intrusive auditing).

我在 JMS 上使用 SOAP 时运气不好。如果它用于即发即弃操作(WSDL 中没有定义响应消息),它确实有一定的意义。在这种情况下,您可以使用 WSDL 生成客户端框架,并且可以将 WSDL 存储在您的服务注册表中。此外,您还可以获得 JMS 的所有常见好处(分离发送方和接收方、负载平衡、优先级排序、安全性、桥接到多个目的地 - 例如非侵入式审计)。

On the other hand SOAP is mainly used for request/reply type operations. Implementing request/reply pattern over JMS introduces the following problems:

另一方面,SOAP 主要用于请求/回复类型的操作。通过 JMS 实现请求/回复模式会引入以下问题:

  • Impossible to handle timeouts properly. You never know if a request is still waiting for delivery or got stuck in the called component.
  • Responses are typically sent on temporary queues. If the client disconnects before receiving the response and there is no explicit time to live set on the response message, the temp queue can get stuck in the JMS server until you restart it.
  • Having a JMS server in the middle dramatically increases roundtrip times and adds unnecessary compexity.
  • JMS provides a reliable transport medium that decouples the sender from the receiver, but in case of request/reply the client should not be decoupled from the server. The client needs to know if the server is up and available.
  • 无法正确处理超时。您永远不知道请求是否仍在等待交付或卡在被调用的组件中。
  • 响应通常在临时队列上发送。如果客户端在收到响应之前断开连接,并且响应消息上没有明确设置生存时间,则临时队列可能会卡在 JMS 服务器中,直到您重新启动它。
  • 在中间放置一个 JMS 服务器会显着增加往返时间并增加不必要的复杂性。
  • JMS 提供了一种可靠的传输介质,可以将发送者与接收者分离,但在请求/回复的情况下,客户端不应与服务器分离。客户端需要知道服务器是否已启动并可用。

The only advantage I could think about is that the server can be moved or load-balanced without the client knowing about it, but using UDDI and HTTP load balancer is a better solution.

我能想到的唯一优点是可以在客户端不知道的情况下移动或负载平衡服务器,但使用 UDDI 和 HTTP 负载平衡器是更好的解决方案。

回答by Petre Maierean

I'd say that from an Architect's prospecting the same question would be about why having a 5 layer Internet model, with the 5th being the application when one could simply code the entire application at the socket level. To abstract out the Transport layer (JMS in your case) from what your application produces or consumes (SOA messages) is a good practice for may reasons amongst which independent unit testing, and future migration to other platforms are the first to come to my mind

我想说,从架构师的探索来看,同样的问题是为什么有一个 5 层 Internet 模型,第 5 层是应用程序,当人们可以在套接字级别简单地对整个应用程序进行编码时。从您的应用程序产生或使用的内容(SOA 消息)中抽象出传输层(在您的情况下为 JMS)是一个很好的做法,原因可能包括独立单元测试和未来迁移到其他平台是我首先想到的

回答by luis.espinal

Goddammit, I hate working with Architect Astronauts. I feel your pain brother. Do they actually have a actual, functional reason for doing so other than "it's a standards"? Is this decision going to lock them into a specific EE container vendor (say WebSphere)? That is so 2002; very few people have a real needfor it; and in fact, SOAP has been pretty much ignored by most practical, successful implementations. Unless they have a real need for more reliability than what it is provided by JMS or SOAP-over-HTTP alone, you are in for a trip.

该死的,我讨厌和建筑师宇航员一起工作。我感到你的痛苦兄弟。除了“这是一个标准”之外,他们是否真的有这样做的实际、功能性原因?这个决定是否会将它们锁定到特定的 EE 容器供应商(比如 WebSphere)?2002 年就是这样;很少有人真正需要它;事实上,大多数实用、成功的实现几乎都忽略了 SOAP。除非他们确实需要比 JMS 或 SOAP-over-HTTP 单独提供的可靠性更高的可靠性,否则您就要去旅行了。

Check the Apache CFX site for some examples (specific to CFX).

检查 Apache CFX 站点以获取一些示例(特定于 CFX)。

http://cxf.apache.org/docs/soap-over-jms-10-support.html

http://cxf.apache.org/docs/soap-over-jms-10-support.html

The rule of thumb would be to really use the bare minimums, and not the full stack. If your architect astronauts still insist in using the whole thing, you might just be walking into a world of pain. Sorry.

经验法则是真正使用最低限度,而不是完整堆栈。如果你的建筑师宇航员仍然坚持使用整个东西,你可能只是走进了一个痛苦的世界。对不起。



EDIT:

编辑:

BTW, what application container will you be using? WebLogic, JBoss, WebSphere? And which web service framework? Apache CFX, Axis?

顺便说一句,您将使用什么应用程序容器?WebLogic、JBoss、WebSphere?以及哪个 Web 服务框架?Apache CFX,轴?

Architects astronauts will love to say that those are implementation details. Bull. Any decision on a system whose change carriers a great cost (or whose implementation carries significant savings) is an architectural decision. These pretty much dictate how things will be implemented (and what the cost of change will be) so determining early on which you will be using is an architectural decision except with very self-contained systems.

建筑师宇航员会喜欢说这些是实现细节。公牛。任何对改变带来巨大成本(或其实施带来显着节省)的系统的任何决策都是架构决策。这些几乎决定了事情将如何实施(以及更改的成本是多少),因此尽早确定您将使用哪个是架构决策,除非非常独立的系统。

A few more links on this controversial subject:

关于这个有争议的主题的更多链接:

http://www.subbu.org/blog/2005/03/soap-over-jmshttp://parand.com/say/index.php/2005/03/29/soap-over-jms-no-such-thing/

http://www.subbu.org/blog/2005/03/soap-over-jms http://parand.com/say/index.php/2005/03/29/soap-over-jms-no-such -事物/

回答by Dwai Banerjee

SOAP/JMS and SOAP/HTTP are used for different scenarios albeit with Message Fire and Request/Response. SOAP/JMS is actually terrific for propagating discovered (if required converted) messages to multiple sourecs simply by usage of SoapAction and targetService. The JMS Specs also help in complex routing using the headers.

SOAP/JMS 和 SOAP/HTTP 用于不同的场景,尽管有 Message Fire 和 Request/Response。SOAP/JMS 实际上非常适合仅通过使用 SoapAction 和 targetService 将发现的(如果需要转换)消息传播到多个源。JMS 规范还有助于使用标头进行复杂的路由。

In Fact, UDDI as well as build servers can, is AND has been used as sources to discover published WSDLs (inline) from massive middleware deployments (Irrespective of engine architecture) as a SOAP/JMS Message to singular SOA Repository Sinks. Very Important in Enterprise Governance

事实上,UDDI 以及构建服务器都可以,并且已经被用作发现从大规模中间件部署(不考虑引擎架构)发布的 WSDL(内联)作为 SOAP/JMS 消息到单一 SOA 存储库接收器的来源。在企业治理中非常重要

Hence it is of utmost importance for wire tap patterns essentially when asynchronicity is of paramount importance.

因此,当异步性至关重要时,它对于线抽头模式至关重要。

SOAP/HTTP and now REST (with the verb noun model) work best for trusted sub-system calls

SOAP/HTTP 和现在的 REST(使用动词名词模型)最适合受信任的子系统调用

回答by ihebiheb

From here:

这里

SOAP over JMS offers an alternative messaging mechanism to SOAP over HTTP. While it is not yet standardized and hence may not be interoperable across platforms, SOAP over JMS offers more reliable and scalable messaging support than SOAP over HTTP. As JAX-RPC and JSR-109 become integral parts of the J2EE standard, enterprise messaging in Web services using SOAP over JMS will become well-established.

SOAP over JMS 提供了一种替代 SOAP over HTTP 的消息传递机制。虽然它还没有标准化,因此可能无法跨平台互操作,但 JMS 上的 SOAP 提供了比 HTTP 上的 SOAP 更可靠和可扩展的消息传递支持。随着 JAX-RPC 和 JSR-109 成为 J2EE 标准的组成部分,使用 SOAP over JMS 的 Web 服务中的企业消息传递将变得完善。

回答by Groovieman

Image you implemented a frequently used Web-Service, that tends to run ouf threads, while you promised, that no message will be lost.

您实现了一个经常使用的 Web 服务的图像,它倾向于运行 ouf 线程,而您承诺不会丢失任何消息。

A Webservice implementation (the server) that runs over a session bean comes with a limited amount of threads (say n active PE in your pool), that may run n web-service request concurrently. What will happen to the n+1 request ?

运行在会话 bean 上的 Web 服务实现(服务器)带有有限数量的线程(比如池中的 n 个活动 PE),它们可以同时运行 n 个 Web 服务请求。n+1 请求会发生什么?

MRDE, didn't you promised you application owner, that no message will be lost. So the JMS quaranties this functionality. The Webservice skeleton only has to store the data in a queue, and this give reliability also with regard to load-peaks.

MRDE,您不是向您的应用程序所有者承诺过不会丢失任何消息。因此,JMS 保证了此功能。Web 服务框架只需将数据存储在队列中,这也为负载峰值提供了可靠性。

The interesting thing about WS over JMS is, that the elapsed time of a running WS-request is quite short, so the computing ressouce will be back immediately to server the next request.

WS over JMS 的有趣之处在于,运行 WS-request 的时间非常短,因此计算资源将立即返回到服务器下一个请求。