The route definition is executed once at start up. This means
"setHeader("Message-ID", constant("<SEMA-CR-" + rand.nextLong() + "@yy>"))"
will also executed once and the same message ID is set each time. Use a
processor, bean or scripting language for this requirement.

Cheers,
Christian

On Tue, Dec 28, 2010 at 3:45 PM, kanmisc <[email protected]> wrote:

>
> Basically I am new to Camel and here is my route.
>
> from("file:data/temp?noop=true").
>  when(header("CamelFileName").isEqualTo("template1.html")).
>  setHeader("Message-ID",constant("<SEMA-CR-"+rand.nextLong()+"@yy>")).
>  to("smtp://localhost:9819?to="myEmailID").
>  bean(FileValidator.class, "processFiles").
>
> when(header("CamelFileName").isEqualTo("template2.html")).
>  setHeader("Message-ID",constant("<SEMA-CR-"+rand.nextLong()+"@yy>")).
>  to("smtp://localhost:9819?to="myEmailID").
>  bean(FileValidator.class, "processFiles");
>
> 1) I have 8 such when() class to process the files. It will be assigned an
> unique id an send to localhost smtp server which in turn posts to internal
> fuse bundle which processes the template and logs response in another
> location(say B). From B, I have to read the reponse content and check for
> validity.
>
> Then the camel has to pick the next file and send to localhost smtp and the
> process continues like this for all the files. The problem here is i need
> that unique id assigned to the file for processing in FileValidator since
> that is the only way response file can be differentiated. Response files in
> B are created like "xxxx_<uniqueId1>.html", xxxx_<uniqueId2>.html"... etc.
> Without unique id It is not possible to pick correct file for validations.
>
> I am just wondering is there any way to suspend the file polling when the
> control is delegated to the bean.
> Thanks
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Processing-files-one-by-one-in-camel-tp3319274p3320321.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Reply via email to