You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Vanshul.Chawla" <Va...@target.com> on 2015/05/29 06:42:02 UTC

Camel File Write per 5 minute

Hello,

We have a Camel context wherein we are writing file per minute.

uri="file:src/output?fileName=XXX_${date:now:yyyyMMddhhmm}_1.txt&amp;fileExist=Append" />

Is there a way we can have a file per 5 minute without writing any extra code?


Thanks and Regards,

Vanshul Chawla


Re: Camel File Write per 5 minute

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

You can use a bean method that computes the file name. And then that
bean has the logic to know about the 5 minute rule.

There is a bean method example here
http://camel.apache.org/file-language.html


On Fri, May 29, 2015 at 7:03 AM, Vanshul.Chawla
<Va...@target.com> wrote:
> Delayer will just delay the message to be sent to consumer.
>
> Our requirement is to keep on appending in a file and create next file after 5 minutes are elapsed. Ie keep file write in append mode so that all messages coming in 5 minutes are placed in file and all messages in next 5 minutes in next file and so on.
>
> Aggregator is an option but we want to write message in file as soon as it comes to us.
>
> Thanks and Regards,
>
> Vanshul Chawla
>
> -----Original Message-----
> From: Ravindra Godbole [mailto:godbolerr@gmail.com]
> Sent: Friday, May 29, 2015 10:19 AM
> To: users@camel.apache.org
> Subject: Re: Camel File Write per 5 minute
>
> Have you explored delayer option. ?
>
> http://camel.apache.org/delayer.html
>
>
> On Fri, May 29, 2015 at 10:12 AM, Vanshul.Chawla <Va...@target.com>
> wrote:
>
>> Hello,
>>
>> We have a Camel context wherein we are writing file per minute.
>>
>> uri="file:src/output?fileName=XXX_${date:now:yyyyMMddhhmm}_1.txt&amp;fileExist=Append"
>> />
>>
>> Is there a way we can have a file per 5 minute without writing any
>> extra code?
>>
>>
>> Thanks and Regards,
>>
>> Vanshul Chawla
>>
>>
>
>
> --
> - Ravi
>
> *[ View My Youtube Channel
> <https://www.youtube.com/playlist?list=PL5Y_TlNjh0D59A4K3yQQR7gNAslnxDmRB>
> ]*
>
> Phone: +91 *98 509 760 91*



-- 
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 Write per 5 minute

Posted by "Vanshul.Chawla" <Va...@target.com>.
Delayer will just delay the message to be sent to consumer. 

Our requirement is to keep on appending in a file and create next file after 5 minutes are elapsed. Ie keep file write in append mode so that all messages coming in 5 minutes are placed in file and all messages in next 5 minutes in next file and so on.

Aggregator is an option but we want to write message in file as soon as it comes to us.

Thanks and Regards,

Vanshul Chawla

-----Original Message-----
From: Ravindra Godbole [mailto:godbolerr@gmail.com] 
Sent: Friday, May 29, 2015 10:19 AM
To: users@camel.apache.org
Subject: Re: Camel File Write per 5 minute

Have you explored delayer option. ?

http://camel.apache.org/delayer.html


On Fri, May 29, 2015 at 10:12 AM, Vanshul.Chawla <Va...@target.com>
wrote:

> Hello,
>
> We have a Camel context wherein we are writing file per minute.
>
> uri="file:src/output?fileName=XXX_${date:now:yyyyMMddhhmm}_1.txt&amp;fileExist=Append"
> />
>
> Is there a way we can have a file per 5 minute without writing any 
> extra code?
>
>
> Thanks and Regards,
>
> Vanshul Chawla
>
>


--
- Ravi

*[ View My Youtube Channel
<https://www.youtube.com/playlist?list=PL5Y_TlNjh0D59A4K3yQQR7gNAslnxDmRB>
]*

Phone: +91 *98 509 760 91*

Re: Camel File Write per 5 minute

Posted by Ravindra Godbole <go...@gmail.com>.
Have you explored delayer option. ?

http://camel.apache.org/delayer.html


On Fri, May 29, 2015 at 10:12 AM, Vanshul.Chawla <Va...@target.com>
wrote:

> Hello,
>
> We have a Camel context wherein we are writing file per minute.
>
> uri="file:src/output?fileName=XXX_${date:now:yyyyMMddhhmm}_1.txt&amp;fileExist=Append"
> />
>
> Is there a way we can have a file per 5 minute without writing any extra
> code?
>
>
> Thanks and Regards,
>
> Vanshul Chawla
>
>


-- 
- Ravi

*[ View My Youtube Channel
<https://www.youtube.com/playlist?list=PL5Y_TlNjh0D59A4K3yQQR7gNAslnxDmRB>
]*

Phone: +91 *98 509 760 91*