On Fri, Mar 11, 2011 at 9:22 PM, Craig Taylor <[email protected]> wrote: > Before I reinvent the wheel, for Camel 2.4 I'm attempting to check for the > following error conditions for done file handling: > > 1) Done file w/o corresponding regular file > 2) Regular file w/o done file after period of time (say 5 minutes). > > I'm currently using a GenericFileExclusiveReadLockStrategy to check for the > done file and returns true in the acquireExclusiveReadLock if found. > > My current thinking for #1 is to treat it as a special case of #2 (I use no > pattern matching on the endpoints). > > I'd create a property on the exchange to define "LOCKFAIL" property for > files that have failed to obtain a lock. My routes would then be configured > to check the exchange property and deal with it. (The LOCKFAIL would be set > based upon a filename, timer map w/in my current > GenericFileExclusiveReadLockStrategy instance). > > Suggestions? This feels wrong based upon having to change all the dependent > routes.. >
In terms of #2 you are maybe a bit into the world of BAM. eg to setup some rules that a "done" file is expected, no later than X time after that a new file arrived in the folder. http://camel.apache.org/bam If you have some sort of BAM to do this, then you will not have to adjust your routes to cater for LOCKFAIL. In Camel you can also use an interceptFrom to detect that LOCKFAIL and detour the message (and use skipSendToOriginalEndpoint). Then you dont have to adjust your routes. http://camel.apache.org/intercept > -- > ------------------------------------------- > Craig Taylor > [email protected] > -- Claus Ibsen ----------------- FuseSource Email: [email protected] Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
