You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Kondalarv <ko...@gmail.com> on 2015/05/20 22:12:57 UTC

Camel File Consumer : Pre processing steps

Here is camel route for file consumer  that picks up file from a directory
and process it. 

(file:/app/test/inbound?readLock=changed&maxMessagesPerPoll=1&preMove=wip&initialDelay=5000&delay=1000&autoCreate=false&move=done/${date:now:yyyy}/${file:name}.${date:now:yyyyMMddhhmmss}).processRef("fileWatcherConsumerProcesser");


But I want to execute pre processing logic once File Consumer started
recognizing the file in folder means still producer is writing the file.

How do I handle the scenario, I appreciate your help. 



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-File-Consumer-Pre-processing-steps-tp5767348.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel File Consumer : Pre processing steps

Posted by Kondalarv <ko...@gmail.com>.
I have to send multiple events to external system based on file status like

 1. File is started coming to directory.
 2.update file size periodically till complete file
 3. Complete file is available 

Step(3)  I can do using process but note sure how to implement other events.




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-File-Consumer-Pre-processing-steps-tp5767348p5767364.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel File Consumer : Pre processing steps

Posted by Claus Ibsen <cl...@gmail.com>.
Why not just add a process in the route as your pre processing step

from file
  process pre
  process what you do now

On Thu, May 21, 2015 at 8:29 AM, Kondalarv <ko...@gmail.com> wrote:
> Thank you for inputs. I would like to do once before every file and need file
> name to execute pre processing logic. Kindly share example if you have any.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-File-Consumer-Pre-processing-steps-tp5767348p5767361.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Re: Camel File Consumer : Pre processing steps

Posted by Kondalarv <ko...@gmail.com>.
Thank you for inputs. I would like to do once before every file and need file
name to execute pre processing logic. Kindly share example if you have any.



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-File-Consumer-Pre-processing-steps-tp5767348p5767361.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel File Consumer : Pre processing steps

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Can you be more specific, only once when the route is starting up, or
once before every file?

You can use route policy / event notifier or use some of the file
processing strategy to plugin and get notifications depending on
needs.

On Wed, May 20, 2015 at 10:12 PM, Kondalarv <ko...@gmail.com> wrote:
>
> Here is camel route for file consumer  that picks up file from a directory
> and process it.
>
> (file:/app/test/inbound?readLock=changed&maxMessagesPerPoll=1&preMove=wip&initialDelay=5000&delay=1000&autoCreate=false&move=done/${date:now:yyyy}/${file:name}.${date:now:yyyyMMddhhmmss}).processRef("fileWatcherConsumerProcesser");
>
>
> But I want to execute pre processing logic once File Consumer started
> recognizing the file in folder means still producer is writing the file.
>
> How do I handle the scenario, I appreciate your help.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-File-Consumer-Pre-processing-steps-tp5767348.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/