Announcement Announcement Module
Collapse
No announcement yet.
initial delay for poller Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • initial delay for poller

    I noticed following in my logs:

    "Configuration problem: Poller configuration via 'interval-trigger' subelements is deprecated, use the 'fixed-delay' or 'fixed-rate' attribute instead."

    If interval-trigger is deprecated, what is the way of setting 'initial-delay' with 'fixed-delay'/'fixed-rate'?

    Thanks

  • #2
    You can provide the "trigger" attribute and reference a bean of type PeriodicTrigger. That bean can be configured with initialDelay as well as its other properties.

    Hope that helps.
    -Mark

    Comment


    • #3
      That is very helpful. Thanks.

      Comment


      • #4
        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

        Comment

        Working...
        X