camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen" <>
Subject Re: Apache Camel and calling Spring Business Services
Date Thu, 04 Dec 2008 07:43:08 GMT

The file component supports moving files after processing using native
File.rename method. What you have in your route is a ending file
producer that writes a new file.
So if you want to move the file after the route completes you can do it as:

> --from("file://C://test//from").bean(MyClass,
> --"myMethod")

Notice the last file is gone. Now we need to instruct the first file
where it should move the file and what name it should be.

You can use the expression option to allow a bean to generate the
name. This expressions uses the file language

> --from("file://C://test//from?expression=myFileNameGeneratorBean").bean(MyClass,
> --"myMethod")

See the links ad they have samples.

/Claus Ibsen
Apache Camel Committer

On Wed, Dec 3, 2008 at 8:44 PM, Franklin Antony
<> wrote:
> Thanks a lot.
> Just some more things.. Where exactly has the spring services need to be
> called or injected ?
> Also assume in this route
> --from("file://C://test//from").bean(MyClass,
> --"myMethod").to("file://C://test//to");
> Assume MyClass having myMethod can log to the database , since the message
> payload is received in MyClass. Now myMethod generates a Random Unique name
> for the file and log it into the database.
> How can the output (file://c://test/to) directory know what is the new name
> of the file ?
> Thanks,
> Franklin
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

View raw message