Hi Yes if you loop 1000 times (or alot) then message history will take up memory on the exchange as each step in the routes is recored by default. You can turn this off http://camel.apache.org/message-history.html
But as Brad says its not ideal to keep looping in Camel routes as they are not intended to run forever/very long routes. You can have higher performance from a java bean in a regular for loop and then if needed use producer template to call a Camel route. On Fri, Oct 14, 2016 at 12:31 AM, Goyal, Arpit <arpit.go...@sap.com> wrote: > Hi, > > We currently are on 2.16.3 version and can't use the loop function (part of > 2.17). So we have the following routes based on which we create sort of loop > with switch case. Now we are worried about the performance (when we see > stacktrace of camel processing) > > Route 1: from("direct:s1).to("read one page of data").process("process one > page").to("direct:s2"); > > Route 2: from("direct:s2").toD("go to external source").when("are more pages > left").to("direct:s1").otherwise().process("end processing"); > > Now if there are thousands of pages, it is possible that this loop creates > lot of objects in memory & can create performance issue? Is there a way for > Camel to be told, before going to route 1 again, forget all the past? Is > disabling HISTORY would solve that? > > Regards, > Arpit. -- Claus Ibsen ----------------- http://davsclaus.com @davsclaus Camel in Action 2: https://www.manning.com/ibsen2