2015-10-21 30 views
0

當前我們使用不推薦使用的jdbc連接器,它對應的jdbc入站端點用於輪詢來自我們數據庫的數據。將jdbc傳輸遷移到mule中的數據庫連接器3.7

我們正在使用.ack(確認(ACK)語句功能)來防止處理重複記錄。

但是,我似乎沒有找到使用新的數據庫連接器相同的功能。我們使用的是Mule社區版,所以我們不能使用批量組件。

是否有可能使用數據庫連接器(結合輪詢組件)具有相同的功能性。或者我們是否需要手動確認我們的記錄?

<jdbc:connector name="dbPollingConnector" dataSource-ref="dataSource" queryTimeout="1000" pollingFrequency="1000"> 
     <receiver-threading-profile maxThreadsActive="1" /> 
     <reconnect-forever frequency="60000"></reconnect-forever> 
     <jdbc:query key="newDataGrouped" value="select * from table where processed = 0"></jdbc:query> 
     <jdbc:query key="newDataGrouped.ack" value="update table set processed = current_timestamp"></jdbc:query> 
</jdbc:connector> 

<flow name="flowName"> 

     <jdbc:inbound-endpoint name="groupedInboundComponent" responseTimeout="1000" queryTimeout="100" 
       pollingFrequency="1000" connector-ref="dbPollingConnector" queryKey="newDataGrouped" exchange-pattern="request-response"> 
     </jdbc:inbound-endpoint> 

     <!--... rest of the flow ... --> 

</flow> 

回答

0

您可以利用Polling for Updates using Watermarks

它與域.Ack略有相似,但沒有修改數據庫中的物理數據。我認爲它只是需要在當前查詢中稍作修改,例如:select * from table where id > #[flowVars['lastModifiedID']]