Reputation: 717
I am trying to create an SQL query inbound connection to my Mule server but I want the query itself to be dynamic (meaning I want to add a value such as: SELECT * FROM SOME_TABLE WHERE TimeStamp > SomeDynamicVariable
).
How would I go about creating such an inbound connection, considering that I want to poll the database every so often?
Upvotes: 3
Views: 1841
Reputation: 33413
In Mule, what you want to achieve is called "requesting" (ie. consuming an endpoint with a custom expression) and is not handled with inbound endpoints.
To achieve your goal you need:
A global JDBC endpoint using a Mule expression for the timestamp value, for example like this:
<jdbc:query key="myQuery" value="SELECT * FROM SOME_TABLE WHERE TimeStamp > #[payload]"/>
A Quartz inbound endpoint to generate an event containing in the payload the timestamp to be used in query,
D.
Upvotes: 2