camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Camel 2.4 Done File Error Handling
Date Sat, 12 Mar 2011 12:56:03 GMT
On Fri, Mar 11, 2011 at 9:22 PM, Craig Taylor <> 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.

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.

> --
> -------------------------------------------
> Craig Taylor

Claus Ibsen
Twitter: davsclaus
Author of Camel in Action:

View raw message