camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: How to use File endpoint to write files to directories in form of 1/2/3/4
Date Wed, 09 Feb 2011 10:15:11 GMT
On Wed, Feb 9, 2011 at 11:02 AM, Tom Howe <> wrote:
> Hi, first post, loving camel! (Using with akka -

Welcome to the community.

> I need to write a lot of files using camel to a directory and need to avoid
> the directory getting to big.
> My endpoint at the moment is just file:/to/my/dir.
> It works ok, except if the harvester of these files goes down for a while
> and the directory gets too many files, bad things happen!
> Is there a config option that will create subdirectories below that using
> random numbers to several dirs deep. eg
> /to/my/dir/1/4/2/filename

No but you can just compute the file name and provide it as the header
with the key: Exchange.FILE_NAME

You can also use a bean to generate some random path and then use a
expression as the file name


See some samples here

The xxx will have the starting path, so the evaluated value of
fileName would be appended.

> Thanks, Tom

Claus Ibsen
Twitter: davsclaus
Author of Camel in Action:

View raw message