3 Replies Latest reply on Feb 3, 2012 1:46 PM by Rogelio Sevilla

    cleaning up seda queue

    Rogelio Sevilla Novice

      Good day everyone:


      I have been playing with fuse ESB and camel for a while now and I have a question about the seda queue that camel uses.


      Currently I insert a bundle in fuse ESB in which I create a couple of camel contexts and I insert some  RouteBuilders to them. These RouteBuilders  make use of the seda queue.. again, everything works great.


      When I remove this bundle from my servicemix installation, my cleanup code destroys everyone of these camel contexts. My only problem is that the camelContext.stop();  method takes a LOT of time to finish because it is waiting for the seda queues to be empty. The fuse ESB log shows something like this:



      11:06:30,715 | INFO  | 5 - ShutdownTask | DefaultShutdownStrategy          | ?                                   ? | 76 - org.apache.camel.camel-core - 2.7.1.fuse-00-27 | Waiting as there

      are still 237 inflight and pending exchanges to complete, timeout in 138 seconds.



      In this particular case, I don't care if the remaining messages are not processed  Is there any way to accelerate the shutdown process?? ; any advice would be appreciated.



      Thanks in advance

        • 1. Re: cleaning up seda queue
          Willem Jiang Master

          DefaultShutdownStrategy is trying to shutdown the camel context in a graceful way.

          You can override the default time out from 60 seconds to 1 seconds.


          All you need to do is define an instance of DefaultShutdownStrategy by setting the timeout property in the camel context configuration file.



          • 2. Re: cleaning up seda queue
            Claus Ibsen Master

            Yeah as Willem says you can lower the timeout of the graceful shutdown. You can read more about it here http://camel.apache.org/graceful-shutdown.html


            And the default timeout is 300 seconds.


            Btw can you tell a bit more about your use-case for just discarding the messages on the seda queues? Maybe its a good use-case, and if so, we could possible enhance Camel to allow you to more easily configure the seda component/endpoints to tell it, to just discard messages when stopping.

            • 3. Re: cleaning up seda queue
              Rogelio Sevilla Novice

              Thanks for your answers mr. Willem and mr. Claus .



              About that use case, I'm not sure if our system would be considered a good one. The application we are developing did not really need Camel, however, the lead programmer in my department considered the app small enough to use it as a way for some of us to start experimenting with Fuse ESB and Camel without sacrificing delivering dates.


              Honestly I haven't used any of these technologies (or similar ones) before, and all I can  say is that I'm pretty amazed so far.