2014-11-06 76 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並建立所需的消息