On Thu, Apr 12, 2012 at 4:37 PM, DEPREZ Arnaud AWL-IT <[email protected]> wrote: > Thanks for your answer but I already have looked at this and it doesn't solve > my problem. > > Actually, my problem is : > When I receive a file, I have to wait 30 minutes (for example) before > processing a second different file. > After the second file, I have to wait again 30 minutes before processing a > third different file. > > The third file comes from a different flow and must be processed after the > second file only. >
Besides suspending/resuming the route using a policy, you could also use a custom filter, and in the filter return false all the time until 30 minutes is gone since last time you said true. And then the default polling frequency by Camel is 2 times per sec, you could bump that up a bit, to once per minute or something. Then you can just keep the route running. > Arnaud > > please don't print unless you really need to > > -----Original Message----- > From: Stefan Burkard [mailto:[email protected]] > Sent: jeudi 12 avril 2012 13:43 > To: [email protected] > Subject: Re: How to suspend/resume a route dynamically by programmation ? > > Hi > > Have a look at http://camel.apache.org/polling-consumer.html. I think > you can solve your problem with a consumer that polls all 30 minutes > for a file. > > Stefan > > > On Thu, Apr 12, 2012 at 11:09, DEPREZ Arnaud AWL-IT > <[email protected]> wrote: >> Hi everyone, >> >> I would like to know if there is a way to suspend/resume dynamically by >> programmation. >> >> For example, >> When I receive a batch file (containing many records), I must process >> another file 30 minutes later. >> >> So in the beginning, my idea was : >> When I received the first file, I will ask to another route (this route >> should process the second file) to wake up in 30 minutes and suspends itself >> after processing the file. >> >> I took a look on the following features : >> >> * Quartz >> >> * Cron >> >> * ScheduledRoutePolicy (which it doesn't work like I want). >> >> But for those features, there are only simple samples on the net. >> >> I still haven't found my happiness so if someone has a good sample, I thank >> him/her very much ! >> Or maybe someone has a better idea to solve this problem ? >> >> KR, >> P please don't print unless you really need to >> >> >> ________________________________ >> >> Atos Worldline SA/NV - Chaussee de Haecht 1442 Haachtsesteenweg >> - 1130 Brussels - Belgium >> RPM-RPR Bruxelles-Brussel - TVA-BTW BE 0418.547.872 >> Bankrekening-Compte Bancaire-Bank Account 310-0269424-44 >> BIC BBRUBEBB - IBAN BE55 3100 2694 2444 >> >> "The information contained in this e-mail and any attachment thereto is >> confidential and may contain information which is protected by intellectual >> property rights. >> This information is intended for the exclusive use of the recipient(s) named >> above. >> This e-mail does not constitute any binding relationship or offer toward any >> of the addressees. >> If you are not one of the addressees , one of their employees or a proxy >> holder entitled to hand over this message to the addressee(s), any use of >> the information contained herein (e.g. reproduction, divulgation, >> communication or distribution,...) is prohibited. >> If you have received this message in error, please notify the sender and >> destroy it immediately after. >> The integrity and security of this message cannot be guaranteed and it may >> be subject to data corruption, interception and unauthorized amendment, for >> which we accept no liability." > > > > Atos Worldline SA/NV - Chaussee de Haecht 1442 Haachtsesteenweg > - 1130 Brussels - Belgium > RPM-RPR Bruxelles-Brussel - TVA-BTW BE 0418.547.872 > Bankrekening-Compte Bancaire-Bank Account 310-0269424-44 > BIC BBRUBEBB - IBAN BE55 3100 2694 2444 > > "The information contained in this e-mail and any attachment thereto is > confidential and may contain information which is protected by intellectual > property rights. > This information is intended for the exclusive use of the recipient(s) named > above. > This e-mail does not constitute any binding relationship or offer toward any > of the addressees. > If you are not one of the addressees , one of their employees or a proxy > holder entitled to hand over this message to the addressee(s), any use of the > information contained herein (e.g. reproduction, divulgation, communication > or distribution,...) is prohibited. > If you have received this message in error, please notify the sender and > destroy it immediately after. > The integrity and security of this message cannot be guaranteed and it may be > subject to data corruption, interception and unauthorized amendment, for > which we accept no liability." -- Claus Ibsen ----------------- CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com FuseSource Email: [email protected] Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
