English 中文(简体)
JMS讯息能否换成民意测验网站服务电话?
原标题:Can JMS messaging be replaced by a polling Webservice call?

Existing scenario: Two Apps are communicating using Queues. One of them is always the Producer, and other is always the consumer.

制片人在自己的存储库中生成和保存数据,然后用Queses发送给消费者。

我越读到JMS消费者(和听众)执行(使用春天)的情况,

这是因为 JMS 收听者所做的只是保持线条打开, 听队列。 所以如果您的 JMS 收听者连接工具设置为 10 个连接, 您将会有 10 个屏蔽线条 。

因此,与其保持10条线的开放,不如使用1条线来进行每30秒左右的民意调查。 一张纸可以指示网络服务公司在答复中发送100个(或更多)数据项目。

最佳回答

两者都是抽象的。 如果您想一想, 它只是一个插座, 您正在将数据推过来。 真正不同的是每个抽象的保证。 足够疯狂的是, 您实际上可以拥有SOAP网络服务, 由使用 HTTP 作为传输工具的 JMS 和 JMS 提供 。

在简短的JMS中,规定了一套与信息传递有关的保障(承认、再传送、故障、etc.),网络服务(大多数人对网络服务的看法)主要包括一套细小的规格,描述在描述运输的规格之上的电文格式(SOAP、JSON)层(HTTP)。

在投票方面,JMS的实施大多是推力模型。 订户向经纪人登记,信息一到,他们就会被推到订户手中。 推力模型的吞吐量高于拉力模型。

问题回答

答案是“ 强力超时” < / 强” 。 通过 JMS, 信息发送时间与发送时间相同, 向消费者提供。 在任何投票解决方案下, 您将总是在平均一半的投票时间里经历潜伏 。

这也消耗了更多的CPU和网络,因为投票的消费者必须每隔一秒钟醒来并实际打电话。

最后,您必须想一想重复和交易。在正确设置 JMS 的情况下,您可以保证收到准确的信息 。

以联医处为基础的通信有其自身的优势,例如:

  • non-blocking (asynchronous) messaging
  • high performance and reliable load balancing
  • high throuput
  • fault tolerant (what if the consumes on other end goes offline)

当然,这一切都是成本的,所以都取决于你需要什么。如果你拥有一个低量的传输系统,每分钟只有几条信息,并且可以忍受由于通信错误而略去一些信息,那么你就可以完全切换到基于投票的网络服务。

如果您想要执行自己的排队服务, 请自便。 唯一主要的好处是不需要依赖第三个组成部分( JMS 服务器 ) 。

如果您再次的资源涉及到10个额外的线条和10个额外的插座, 那么除了使用 JMS 服务器之外, 您还有其它问题需要担心。 广告上也没有足够多的增量成本来重要 。

如果您根本不需要排队, 只需将网络服务按线调用, 就可以完成 。

如果您自己执行,则必须执行队列、耐久性和恢复(当您的系统在第29秒下降并丢失100条未发信件时)、交易恢复、重新连接逻辑等。

如果为了单列到一个目的地的单个生产商,我不得不这样做,而JMS服务器每年花费3000美元的许可证费等等,那么,是的,我当然会考虑自己重新做这个逻辑。或者如果我不想承担JMS服务器的记忆压力。

但JMS服务器是免费的,它们随我的应用程序服务器而来,它们用半打鼠标点击重新配置,它们“足够快”满足大多数需要。它们今天成为无处不在的基础设施。

几率真的很高 完全不值得努力重塑这个轮子 IMHO





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签