2014-11-06 78 views
0

我在JMS队列上有不同的xml消息。每条消息都有引用文档ID字段。现在我想如果两条消息具有相同的参考文档ID,那么它将使一个XML响应,反之亦然。使用WSO2在一个xml结构中组合Jms消息ESB

像XML:

消息-1

<Root> 
<record> 
<refdocumentId>123</refdocumentId> 
<name>abc</name> 
</record> 
</Root> 

消息-2

<Root> 
<record> 
<refdocumentId>123</refdocumentId> 
<name>xyz</name> 
</record> 
</Root> 

的messge-3

<Root> 
<record> 
<refdocumentId>222</refdocumentId> 
<name>abc</name> 
</record> 
</Root> 

在WSO2 ESB输出应该是这样的:

为相同的参考文档ID(单条消息)

<Root> 
    <record> 
    <refdocumentId>123</refdocumentId> 
    <name>abc</name> 
    </record> 
<record> 
    <refdocumentId>123</refdocumentId> 
    <name>xyz</name> 
    </record> 
    </Root> 

对于不同的参考文档ID:

<Root> 
    <record> 
    <refdocumentId>222</refdocumentId> 
    <name>abc</name> 
    </record> 
    </Root> 

我们怎样才能实现WSO2 ESB这个场景。任何帮助将非常感谢。

回答

0

你可以尝试的是,有一个自定义类中介,其中保留一个列表和存储参考ID。每当新消息遇到ESB时,检查该ID并建立所需的消息