Reputation: 271
I need a custom adapter which polls a custom resource. (It returns a List of File.)
Is it able to implement and use it in spring integration?
What would be the best practice of implementing such a pollable resource?
Upvotes: 7
Views: 1696
Reputation: 121560
See the <inbound-channel-adapter>
:
<int:inbound-channel-adapter ref="source1" method="method1" channel="channel1">
<int:poller fixed-rate="5000"/>
</int:inbound-channel-adapter>
Where source1
is something like:
public class MyService {
public List<File> method1() {
....
}
}
Your method will be invoked each that fixed-rate
interval.
Upvotes: 6