Reputation: 89
Currently we are using the deprecated jdbc connector and it's corresponding jdbc inbound endpoint to poll data from our database.
We are using the .ack (Acknowledgment (ACK) Statements feature) to prevent processing duplicate records.
I however don't seem to find the same funciontalility using the new database-connector. We are using the Mule Community edition, so we cannot use the batch components.
Is there a possiblity to have the same functionalitity using the database connector (in combination with the polling component). Or will we have to manually do the acknowledgement of our records?
<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>
Upvotes: 0
Views: 119
Reputation: 1277
You can utilize Polling for Updates using Watermarks
It works slightly similar with .ack, but without modifying physical data in database. I think it just need minor modification in current query, e.g.: select * from table where id > #[flowVars['lastModifiedID']]
Upvotes: 0