如何使用 Mule ESB 过滤出站路由?
我有一个 Mule 实例,配置为处理来自第三方提供商的 xml 响应。最近,提供商已转向新版本,因此更改了 xml 响应。现在我需要一种方法来识别响应是 v1 还是 v2 实现,并调用我这边的适当端点来处理响应。
我目前所拥有的是:
<service name="processResponse">
...
<outbound>
<pass-through-router>
<cxf:outbound-endpoint address="..." clientClass="..." wsdlPort="..." wsdlLocation="..." operation="..."/>
</pass-through-router>
</outbound>
</service>
我更愿意在 mule 中添加一个过滤器来识别第 3 方的修订(可能通过响应中的 xml 命名空间),然后调用适当的类。我找不到任何好的例子。
有人可以提供一个如何解决这个问题的例子吗?
I have a instance of Mule that is configured to process xml responses from a third party provider. Recently the provider has moved to a new revision and hence changed the xml response. Now I need a way to identify if the response is a v1 or v2 implementation and call the appropriate endpoint on my side to process the response.
What I have currently is:
<service name="processResponse">
...
<outbound>
<pass-through-router>
<cxf:outbound-endpoint address="..." clientClass="..." wsdlPort="..." wsdlLocation="..." operation="..."/>
</pass-through-router>
</outbound>
</service>
I would prefer to add a filter in mule to identify the revision of the 3rd party (perhaps through the xml namespace in the response), and then call the appropriate class. I cannot find any good examples of this.
Can someone provide an example of how this could be solved?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看一下此示例,其中演示了一些版本转换。
Take a look at this example, where some version transformation is demonstrated.
我怀疑最直接的方法是使用 xpath 过滤器过滤路由。首先为每个版本定义vm服务。接下来,您将通过具有以下出站端点的服务来过滤它们。包罗万象总是一个好主意。
I suspect the most straight forward means is a filtered route using an xpath filter. First define vm services for each version. Next you'll filter to them through a service with following outbound endpoint. A catch all is always a good idea.