James,

My idea was to split the content of the file during its parsing and to send
on the bus as many messages as block that we have. e.g. If my file contains
1.000 records, than the split will create 10 messages. Each message contain
100 records that next I will transform to a collection of POJO.

Regards,

Charles


James.Strachan wrote:
> 
> On 26/03/2008, cmoulliard <[EMAIL PROTECTED]> wrote:
>>
>>  Hi,
>>
>>  I would like to know if it is possible or could be add as a new feature
>> to
>>  split a file containing thousands of records into several block of
>> messages
>>  (1 block can contain by example 100 records) using the splitter strategy
>> ?
> 
> The current Splitter actually supports - provided you have some
> expression that can take the File and generate an iterator over it to
> create the individual message bodies you want to send.
> 
> So you could do something like...
> 
>   from("file:///c:/temp?noop=true)").
>     splitter().method("myBean", "split").
>     to("activemq:someQueue")
> 
> Then register "myBean" with a split method...
> 
> class SomeBean {
>   public Iterator split(File file) {
>      /// figure out how to split this file into rows...
>   }
> }
> 
> How were you planning on parsing/splitting the file?
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> Open Source Integration
> http://open.iona.com
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Use-splitter-strategy-to-send-block-of-messages-on-the-bus-%21-tp16300787s22882p16323599.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to