camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Scanning/Splitting Large input files
Date Mon, 25 Jan 2010 19:00:02 GMT
On Mon, Jan 25, 2010 at 7:37 PM, Kevin Jackson <foamdino@gmail.com> wrote:
> Hi,
>
>> How do you want to split your file. Can you split it on some sort of
>> token, which is required by the Scanner?
>
> I need to split on '**'
>
> I wrote a simple POJO with a splitBody() method that returns a
> List<String> based on this using a Scanner within the method
>
>> You can use POJO to return a String value which then will be used by
>> the Scanner.
>> For example in that splitBody method in the sample above it could be defined as
>>
>> public String splitBody() {
>>  return "\n";
>> }
>
> Ah that is much simpler so I can use the underlying Scanner instead of
> instantiating a new one.
>
> Can you confirm that the spring xml config is correct?  I can only
> find examples of the Java DSL for this - I'll happily provide a patch
> to the docs if the previous spring xml config is correct.
>

A good idea is to peek in the camel-spring component as there are a
bunch of tests using Spring XML

eg. like this one
https://svn.apache.org/repos/asf/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/splitterMethodCallTest.xml

> Thanks I'll refactor tomorrow and save myself some LOC,
> Kev
>

If you only need to split on ** then you can do all in XML only = no
need for POJO
https://svn.apache.org/repos/asf/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/splitterTokenizerTest.xml

If that works for you, feel free to help with the wiki docu
http://camel.apache.org/contributing.html

-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Mime
View raw message