Mule 出站端点级别统计,以促进集成测试

Mule outbound endpoint level statistics to facilitate integration testing

我正在寻找一个实用的解决方案来对基于 Mule 的集成层进行集成测试。

这篇文章 here 有一些很好的建议,但看起来有点过时了。我正在从这里的文章中复制一个绝妙的想法

Keeping track of the delivery of messages to external systems. Interrogating all the systems that have been contacted with test messages after the suite has run to ensure they all received what was expected would be too tedious to realize. How to keep track of these test messages? One option could be to run Mule ESB with its logging level set to DEBUG and analyze the message paths by tracking them with their correlation IDs. This is very possible. I decided to follow a simpler and coarser approach, which would give me enough certitude about what happened to the different messages I have sent. For this, I decided to leverage component routing statistics to ensure that the expected number of messages where routed to the expected endpoints (including error messages to error processing components). Of course, if two messages get cross-sent to wrong destinations, the count will not notice that. But this error would be caught anyway because each destination will complain about the error, hence raising the count of error messages processed.

当我测试我的集成层时使用这种技术,我将不必支持所有外部系统并且可以单独测试集成层,这会很棒。

@David Dassot 也提供了一个参考实现,但是我认为它是基于 Mule 2.X 的,因此我在 Mule 3.X 代码库中找不到 类。

环顾四周,我确实找到了 FlowConstructStatistics,但这是特定于流量的统计信息,我正在寻找特定于端点的统计信息。

我同意,作为解决方法,我们可以将所有出站端点包装在子流中并使其正常工作,但我想避免这样做...

任何有助于查询端点的调用次数、通过端点传递的负载的技术都很棒!

先看看JMX,也许你需要的就在那里。

否则,如果搜索不够,升级到企业版也不行。试试 endpoint level notifications.