3 Replies Latest reply on Mar 5, 2009 12:28 PM by Claus Ibsen

    Start/stop routes

    HUBERT PACROS Newbie

      I am currently working on a project which routes messages :

      • from JMS Topic to MSMQ Queue

      • from MSMQ Queue to JMS Topic

       

      We are using the camel-msmq component and some routes defined in the configuration file.

       

      We must be able to start and stop these routes from an external GUI, but in the JMX console, start and stop methods for a route both throw an Exception (it's harcoded in the source code).

       

      How can we start and stop routes from the JMX Console (or an external GUI) ?

       

      If this can't be achieved through the JMX console, can anyone point me to an example code showing how to access camel object ?

       

      Is there a way to disable the automatic start of a route ?

       

      Thanks

        • 1. Re: Start/stop routes
          Torsten Mielke Apprentice

          It appears that some conversation was lost on this thread. I will try to add it here.

           

          From davsclaus:

           

          Hi

           

          The dynamic aspect of start/stopping/editing routes is being worked on in Camel 2.0. James Strachan have created a brand new camel web console for this purpose. On the road to this he have improved the camel core to cater for starting and stopping individual routes on the fly.

           

          In Camel 1.x you can probably only start and stop the entire Camel Context.

           

          About the web console:

          http://camel.apache.org/web-console.html

           

           

          From hubert.pacros 

           

          Please can you point me to an example code showing how to connect to a running broker and perform actions below from an external application :

          ?     stopping an existing camelContext

          ?     starting a camelContext defined in the activemq.xml file

           

           

          From davsclaus:

           

          Hi

           

          Yeah you can connect using jconsole and stop and start the camel context.

           

          See

          http://camel.apache.org/camel-jmx.html

           

           

          From hubert.pacros:

           

          I have tried stopping the camelContext from the jconsole, but then it disappears and I can't start it again.

           

           

          • 2. Re: Start/stop routes
            Torsten Mielke Apprentice

            The problem here might be that the jmx agent is defined within the camel-context.

            <camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
              <jmxAgent id="agent" createConnector="true"></jmxAgent>
                ...
            </camelContext>
            

            Stopping the context via JMX takes down the JMX agent as well it seems to me.

            • 3. Re: Start/stop routes
              Claus Ibsen Master

              Yeah stopping a camel context is stopping the entire Camel context.

               

              But you can have multiple contexts, so you can maybe have a master context with the jmx connector, and then login to that one to stop the other one.

               

              Yet again James is working on doing this much more dynamic in Camel 2.x.