camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ext2" <>
Subject Re: Splitting a List and deleting it at the end
Date Tue, 14 Dec 2010 13:00:46 GMT
Backup it in a message header before entering split, then you can use it.

But if memory cost is a critical problem for you, you'd better to redesign
from endpoint's implementation, which should not loading all objects in
memory at once, but return a iterator which will sequential load the objects
to memory while iterating. 

Also you should enable "stream" options of split pattern, it will use you
iterator to iterating object;

Finally , you must using try-finally to guarantee the iterator being closed;

Sender: Yann [] 
Date: 2010/7/29 21:23
Subject: Splitting a List and deleting it at the end


I'm splitting a list containing 100 000 objects. Each object is sent to a
queue after a short delay.
If I don't clear my list, my JVM will explode (java heap space...). How
could I get my initial list after splitting it ?
Below my route : 
	 // List split
         // delay
         // body conversion
         // queue
        // this is where I should be able to clear the list!

Thanks for any help !
View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message