on ‎2019 Jan 29 7:56 PM - last edited on ‎2024 Feb 03 5:30 PM by postmig_api_4
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.
Request clarification before answering.
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:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.