2013-05-27 123 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

相关问题