JDBC inbound channel adapter
Generates messages by polling a database using an SQL query.
Inbound channel adapter that generates messages by executing an SQL SELECT query on a database, creating messages from the query result.
Optionally this adapter can also execute an SQL UPDATE statement to mark the records returned by the SELECT query as processed, so that they don't show up in the next poll.
SQL data source
Reference to a JDBC data source, usually including some form of connection pooling, used for accessing the database.
Required
SQL query
A SELECT query to execute when a message is polled. The result of this query will be the body of the outgoing message.
The query can return multiple rows; if you want to convert rows in the SELECT query result to individual messages you can use a downstream splitter.
Required
SQL update
An optional UPDATE statement that is being used to mark the records returned by the SELECT query as processed, so that they don't show up in the next poll.
Note that you can use the values of columns from the SELECT query result as parameters in the UPDATE query by prefixing the name with a colon.
An example of an UPDATE query that uses the 'id' values from the SELECT query:
SELECT * from mytable WHERE processed = FALSE
UPDATE mytable SET processed = TRUE where id IN (:id)
Optional
Maximum rows per poll
Limits the number of rows extracted per query.
If not specified all rows are extracted into the outgoing message.
Optional
Update per row
Flag to indicate whether the update query should be executed per message, or per row (in the case that a message contains multiple rows).
Default is false
, i.e. the update query is executed once per message.
Channel
Channel where the generated messages should be sent to.
You can select the nullChannel
here to silently drop the messages.
Required
Specifies when and how the reading task is executed.
Default global poller is used when empty
Use default poller
Specifies if the global (default) poller should be used or an included poller.
The poller specifies when and how the reading task is executed.
If the global poller is used it should be added as separate support object.
Id
Name that uniquely identifies this flow component.
Required
Max messages per poll
Specifies the maximum number of messages to receive within a given poll operation.
The poller will continue trying to receive without waiting until either no message is available or this maximum is reached.
For example, if a poller has a 10 second interval trigger and a maxMessagesPerPoll setting of 25, and it is polling a channel that has 100 messages in its queue, all 100 messages can be retrieved within 40 seconds. It grabs 25, waits 10 seconds, grabs the next 25, and so on.
Default is 1.
Receive timeout
Specifies the amount of time the poller should wait if no messages are available when receiving.
Send timeout
Specifies the timeout for sending out messages.
Task executor
Task executor to execute the scheduled tasks.
Default when empty: TaskScheduler with name 'taskScheduler', created if not exists.
Error channel
The channel that error messages will be sent to if a failure occurs in this poller's invocation. To completely suppress exceptions, provide a reference to the nullChannel here.
Trigger type
A trigger specifies the schedule of the poller.
Trigger types:
1. Fixed delay trigger Triggers with a periodic constant interval. Each execution is scheduled relative to the actual execution time of the previous execution. If an execution is delayed for any reason (such as garbage collection or other background activity), subsequent executions will be delayed as well.
2. Fixed rate trigger Triggers with a periodic constant interval. Each execution is scheduled relative to the scheduled execution time of the initial execution.If an execution is delayed for any reason , two or more executions will occur in rapid succession to "catch up."
3. Cron trigger Enables the scheduling of tasks based on cron expressions. Consider using a cron trigger for hourly, daily, and monthly settings.
Time unit
Specifies the time unit of the fixed delay or fixed rate value.
For hourly, daily or monthly settings, consider using a cron trigger instead.
Default is Milliseconds
.
Fixed delay
Time between each two subsequent executions, measured from completion time.
Fixed rate
Time between each two subsequent executions, measured from start time.
Cron
Pattern used by a cron-trigger to specify the trigger schedule.
The pattern is a list of six single space-separated fields, representing second minute hour day month weekday
. Month and weekday names can be given as the first three letters of the English names.
Example patterns:
0 0 * * * *
= the top of every hour of every day
0 0 8-10 * * *
= 8, 9 and 10 o'clock of every day
0 0/30 8-10 * * *
= 8:00, 8:30, 9:00, 9:30 and 10 o'clock every day
0 0 9-17 * * MON-FRI
= on the hour nine-to-five weekdays
0 0 0 25 12 ?
= every Christmas Day at midnight