On Wed, Sep 29, 2010 at 12:44 PM, Tarjei Huse <tar...@scanmine.com> wrote:
>  Hi, I got a huge file I want to split into smaller chunks and send each
> chunk as a new message using the splitter. The file contains Protobuf
> objects so I cannot use any of the normal splitting methods, but I want
> to use the streaming() method on the route. How do I create a splitter
> that supports this?
>

Just let the method return an Iterator type and then you can return
the data in chunks as you like.
The streaming mode will then walk the iterator on demand until hasNext
returns false.


> I.e:
> FileSplitter fs = new FileSplitter();
>  from("file://myfile")
>            .routeId(InjectFiles.class.getSimpleName())
>            .split().method(fs,
> "splitMessage").streaming().stopOnException()
>
>
> --
> Regards / Med vennlig hilsen
> Tarjei Huse
> Mobil: 920 63 413
>
>



-- 
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

Reply via email to