2 Replies Latest reply on Sep 15, 2013 5:27 AM by davsclaus

    Can I manually trigger a camel route, given it takes no input?

    vikingsteve

      Given I am running my applications in fuse, and I can see the routes via route-list:

       

      admin@server1> route-list

      Route Id             Context Name         Status

      [MyServiceRoute   ] [MyServiceCamelContext] [Started           ]

       

      For testing purposes, is there a way I can trigger this route via the command line? Something like route-start?

       

      The context is this: My route is usually triggered by the cron component. It takes no input.

       

      Of course I can build a JMX component which starts it, but sometimes I would just like to start things manually during testing.

       

      Thanks for any tips

      viking steve.

        • 1. Re: Can I manually trigger a camel route, given it takes no input?
          ffang

          Hi,

           

          I believe the camel:route-start shell command should help here

           

          camel:route-start --help

          DESCRIPTION

                  camel:route-start

           

              Start a Camel route or a group of routes

           

          SYNTAX

                  camel:route-start [options] route [context]

           

          ARGUMENTS

                  route

                          The Camel route ID or a wildcard expression

                  context

                          The Camel context name.

           

          OPTIONS

                  --help

                          Display this help message

           

          Freeman

          • 2. Re: Can I manually trigger a camel route, given it takes no input?
            davsclaus

            You cannot do this from the karaf shell.

             

            But the web console with hawtio allows you to do that. http://hawt.io/ You can send messages to Camel endpoints. Though forcing a route to trigger from a quartz endpoint is harder as its really only quartz which can do this. If we open up for being able to send a message to any Camel route, then that could also be a little security risk. Though as you say for some kind of DEVELOPER mode it may be desirable to do so easily.