On 09/29/2010 01:31 PM, Claus Ibsen wrote:
> 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.
Duh!

I'm quite sure that you have answered this question to me before and I
have forgotten. Sorry about that. I'll try to update the wiki so I do
not repeat my questions.

One thing though, do I have to set streaming mode explicitly when using
an iterator or will that come implicitly then?

Regards,
Tarjei
>
>> 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
>>
>>
>
>


-- 
Regards / Med vennlig hilsen
Tarjei Huse
Mobil: 920 63 413

Reply via email to