You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Gnanaguru S <gn...@wipro.com> on 2012/04/23 11:53:43 UTC
Camel:Flatpack component
Hi
I have a fixed width text log file. I want to parse it.
This is the file structure
line1:[ENTRY1]:[ENTRY2]:[ENTRY3]
line2:[ENTRY1]:[ENTRY2]:[ENTRY3]
line3:[ENTRY1]:[ENTRY2]:[ENTRY3]
Will i be able to capture all three entries for every new entry and write to
a database. Only the new entries should be read for every file read.
How far camel can help me in this, I feel better to write in camel than to
write a standalone java code. Somebody can help me?
Regards
Guru
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Flatpack-component-tp5658839p5658839.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel:Flatpack component
Posted by Gnanaguru S <gn...@wipro.com>.
Hi Charles,
I was successful in using the stream component. I created a route like shown
below. It works.
I want to combine bindy component, Since now I am getting empty files on
other endpoint.
Please share your knowledge on this. I am using xml way of coding. How can I
combine these two components.
Logically I am struck.
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<from
uri="stream:in:file?fileName=//input//test.txt?scanStream=true?scanStreamDelay=1000"/>
<to uri="file://output"/>
<to uri="log:SUCCESS"/>
</route>
</camelContext>
Regards
Guru
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Flatpack-component-tp5658839p5661543.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel:Flatpack component
Posted by Charles Moulliard <cm...@gmail.com>.
You can combine the stream component (http://camel.apache.org/stream.html)
to avoid to read each time all the entries of a file and a Camel DataFormat
from("stream:file?fileName=/server/logs/server.log&scanStream=true&scanStreamDelay=1000")
On Mon, Apr 23, 2012 at 12:11 PM, Gnanaguru S <
gnanaguru.sattanathan@wipro.com> wrote:
>
> Hi Charles,
>
> So this will support me in reading the new entries alone ?
>
> I dont want to read the file every time from the first line.
>
> Thanks
> Guru
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-Flatpack-component-tp5658839p5658874.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
Re: Camel:Flatpack component
Posted by Gnanaguru S <gn...@wipro.com>.
Hi Charles,
So this will support me in reading the new entries alone ?
I dont want to read the file every time from the first line.
Thanks
Guru
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Flatpack-component-tp5658839p5658874.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel:Flatpack component
Posted by Charles Moulliard <cm...@gmail.com>.
Hi Guru,
The structure that you have to parse (FixedLength or CSV) could be parsed
easily using camel-bindy dataformat.
Please have a look here : http://camel.apache.org/bindy.html
Regards,
Charles
On Mon, Apr 23, 2012 at 11:53 AM, Gnanaguru S <
gnanaguru.sattanathan@wipro.com> wrote:
> Hi
>
> I have a fixed width text log file. I want to parse it.
>
> This is the file structure
>
> line1:[ENTRY1]:[ENTRY2]:[ENTRY3]
> line2:[ENTRY1]:[ENTRY2]:[ENTRY3]
> line3:[ENTRY1]:[ENTRY2]:[ENTRY3]
>
> Will i be able to capture all three entries for every new entry and write
> to
> a database. Only the new entries should be read for every file read.
>
> How far camel can help me in this, I feel better to write in camel than to
> write a standalone java code. Somebody can help me?
>
> Regards
> Guru
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-Flatpack-component-tp5658839p5658839.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>