0

我们有一个基于 JMS 的消息传递应用程序,每天处理大约 200 万条消息。

现在我们要推出一项附加功能,它会影响 60% 的总消息,即每天 120 万条消息。计划是有一个内部队列,我们​​将在该队列上转发此附加功能的消息

到目前为止想到的 2 个设计选项是:

a) 将所有消息转发到第二个队列,消息驱动 bean (MDB) 将在该队列上处理它们——这使第一个应用程序无法知道是否需要此功能。

b) 在原始应用程序中,仅过滤掉 60% 的流量并将它们转发到必要的队列——从而减少内部不必要的流量

所以从本质上平衡设计与体积——我们应该走哪条路?

4

1 回答 1

1

Option B. might give you a headace in the future. Keeping such filtering logic inside two business applications is rarely a good idea - think about changes to the filtering rules in the future that will trigger new versions of two applications.

1.2M msgs/day is quite a number, if the messages are not tiny. Your solution A) is the easiest to build and handle of time, if the systems can cope with the volumes. I would do some load testing and if everythings is fine, go ahead with b).

Depending on which plattform you are building on etc. many middleware and messaging products offers logic and filtering features that can be applied in the middleware, rather than in the actual application.

[First Queue] -> Middleware, Copy All -> [Orig Appl. input queue]
                           , Filter   -> [New application input queue]

For instance, this could easily be configured via Apache Camel in a few lines of XML.

于 2012-07-29T22:14:44.510 回答