cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Spring Integration Poller Cron not working

Former Member
0 Likes
1,468

Hi All,

In our datahub implementation we are pulling the data from API's and pushing it.We have implemented by using the below spring integration.

I am facing issue with poller cron , as its not getting invoked when the method loadNewProducts is running longer than 59 mintues.

 <inbound-channel-adapter channel="ibcaChannel" auto-startup="true" ref="ibcaBean" method="prepareMessage">
         <poller cron="0 0/59 * * * *"></poller>
     </inbound-channel-adapter>
 
     <service-activator input-channel="ibcaChannel" ref="newProductHierarchy" method="retrieveAndLoadProductHirarchy" output-channel="newProductsChannel" /> 
 
     <service-activator input-channel="newProductsChannel" ref="newProducts" method="loadNewProducts" output-channel="routingChannel" />
     
     <header-value-router input-channel="routingChannel" header-name="Validator">
         <mapping value="Failure" channel="terminateChannel"/>
         <mapping value="Success" channel="updateProductStatusChannel"/>
     </header-value-router>
     
     <service-activator input-channel="terminateChannel" ref="killService" method="stopProductCreateService" output-channel="endChannel" />
     
     <service-activator input-channel="updateProductStatusChannel" ref="runningStatus" method="settingStatus" output-channel="endChannel" />

Thanks in Advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

mpern
Product and Topic Expert
Product and Topic Expert
0 Likes

AFAIK, this is expected behaviour for Spring Integration. The next trigger will only occur if the previous completes.

You need to hand of the processing of loadNewProducts to a different thread using a QueueChannel or ExecutorChannel to ensure the processing is triggered exactly every 59 minutes. But beware of the load on the server in that case and potential multithreading issues, because you load two potentially conflicting data sets in parallel.

Check this Spring forum thread:

http://forum.spring.io/forum/spring-projects/integration/130289-how-to-poller-to-wait-for-first-poll...