2013-05-27 230 views
0

我想這個問題可能是'MULE_CORRELATION_ID'。我使用標籤來處理一批數據。配置如下:Mule ESB在第一次後沒有第二次運行

<jdbc-ee:connector name="jdbcConnector" dataSource-ref="dataSource" pollingFrequency="2000" queryTimeout="-1" transactionPerMessage="false" resultSetHandler-ref="resutSetHandler" doc:name="Database"> 
    <jdbc-ee:query key="read" value="SELECT 1 as CID, A.* from ewell_login_user A"></jdbc-ee:query> 
</jdbc-ee:connector> 
<file:connector name="output" outputAppend="true" outputPattern="#[function:datestamp].txt" doc:name="File"></file:connector> 
<flow name="zhicall-zhongshan" doc:name="zhicall-zhongshan"> 
    <jdbc-ee:inbound-endpoint queryKey="read" connector-ref="jdbcConnector" doc:name="Database"> 
    </jdbc-ee:inbound-endpoint> 
    <message-properties-transformer doc:name="Message Properties" > 
     <add-message-property key="MULE_CORRELATION_GROUP_SIZE" value="10"/> 
     <add-message-property key="MULE_CORRELATION_ID" value="10000"/> 
    </message-properties-transformer> 
    <collection-aggregator timeout="5000" failOnTimeout="false" doc:name="Collection Aggregator"/> 
    <custom-transformer encoding="UTF-8" class="com.zhicall.esb.transformer.TestTransFormer" doc:name="Java"/> 
    <stdio:outbound-endpoint doc:name="STDIO" responseTimeout="10000" system="OUT" encoding="UTF-8"/> 
</flow> 

回答

2

對於每組消息,MULE_CORRELATION_ID必須是唯一的。
你不應該設置它,如果你這樣做,你需要確保你爲每個組使用不同的ID。

+0

如果我將MULE_CORRELATION_ID註釋掉,MULE_CORRELATION_GROUP_SIZE不會生效,導致變壓器一次處理一條記錄。那麼我應該如何修改配置? THKS! – Roy

+0

爲了確保每個group-id都是唯一的,我將MULE_CORRELATION_ID的值設置爲表達式'#[function:datestamp]'。這次這款應用一次又一次地運行,但是另一個問題讓我很困惑。問題是MULE_CORRELATION_GROUP_SIZE似乎每次都不會生效。有時組的大小小於10.有時候,應用程序會拋出異常。一次可以輪詢多組數據。 – Roy

相關問題