You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by vkarkhanis <vk...@gmail.com> on 2013/06/11 20:01:38 UTC

Can enabling hangup support cause out of memory?

Hello,
We have our routes configured as follows:


    <routeContext id="myRoute"
xmlns="http://camel.apache.org/schema/spring">
        <route>
            <from "quartz://groupName/timerName?cron=expression"/>
            <process ref="processor1"/>
            <process ref="processor2"/>
            <process ref="processor3"/>
             
            <onException>
                  ------
             <onException>

        </route>
      </routeContext>

 <camelContext id="myCamelContext"
xmlns="http://camel.apache.org/schema/spring">
    <routeBuilder ref="myRoute" />    
  </camelContext>


We have enabled the hang up support in the main class as explained in the
example:

public void boot() throws Exception {
        // create a Main instance
        main = new Main();
        // enable hangup support so you can press ctrl + c to terminate the
JVM
        main.enableHangupSupport();
        // bind MyBean into the registery
        main.bind("foo", new MyBean());
        // add routes
        main.addRouteBuilder(new MyRouteBuilder());

        // run until you terminate the JVM
        System.out.println("Starting Camel. Use ctrl + c to terminate the
JVM.\n");
        main.run();
    }


The quartz scheduler triggers the route as per schedule and processing takes
place. The route is replicated 7 times and added to the same camel context
as separate routeBuilder references. So the context keeps running and the
quartz scheduler keeps triggering routes at scheduled intervals. After
keeping this running for around 6 hours, we experience out of memory. Though
we would be analyzing the JVM at that point, I have following questions
regarding the setup:

1. With this kind of set up, are there chances of the routes holding up on
the resources acquired and not cleaning them up, even after the route is
complete, as the camel context is up and running always..?
2. Do we need to provide any stopping mechanism for the route after the last
processor executes. Please remember the routes should re-trigger as per
schedule.
3. Will camel spawn a new thread every time the route is to be re-triggered 
based on schedule and reuse just one instance of route or will it create new
instance of route everytime for each new thread?

Since I am new to camel, the questions may seem to be very basic.. :)

Thank you,
Regards

Vaibhav A. Karkhanis




--
View this message in context: http://camel.465427.n5.nabble.com/Can-enabling-hangup-support-cause-out-of-memory-tp5734105.html
Sent from the Camel - Users mailing list archive at Nabble.com.