Hello pgondi,
I appreciate a lot your question.
And thanks to Mark for the response.
I would have prefered to use the namespace:
Code:
<task:executor id="senderTaskExecutor" pool-size="5" queue-capacity="50" /><!-- WorkManagerTaskExecutor in production -->
<int:inbound-channel-adapter id="senderPoller" ref="myServiceActivator" method="obtainRecordsToBeSent" channel="out">
<int:poller initial-delay="${sender.initialDelay}" fixed-rate="${sender.frequency}" time-unit="SECONDS" task-executor="senderTaskExecutor"/>
</int:inbound-channel-adapter>
Instead of creating my own bean:
Code:
<task:executor id="senderTaskExecutor" pool-size="5" queue-capacity="50" /><!-- WorkManagerTaskExecutor in production -->
<bean id="senderTrigger" class="org.springframework.scheduling.support.PeriodicTrigger"
c:period="${sender.frequency}" c:timeUnit="SECONDS"
p:initialDelay="${sender.initialDelay}"
/>
<int:inbound-channel-adapter id="senderPoller" ref="myServiceActivator" method="obtainRecordsToBeSent" channel="out">
<int:poller trigger="senderTrigger" task-executor="senderTaskExecutor" />
</int:inbound-channel-adapter>
Maybe it would be possible to parse a "initial-delay" attribute when configuring the trigger at PollerParser.configureTrigger(...). Of course, if it creates a PeriodicTrigger.
But I don't know if it's that useful (I have problems in tests, because I need to populate a database before the execution of the task that selects from that database)
In any case, Mark's response has helped me