If you just want to start a simple Camel app and then shutdown, there is no
requirement to use a test case - you can just use a standard main method
like in the jms-file example:

http://svn.apache.org/repos/asf/camel/trunk/examples/camel-example-jms-file/src/main/java/org/apache/camel/example/jmstofile/CamelJmsToFileExample.java

This uses the exec-maven-plugin to run the main method on the class with all
Maven deps on the classpath.

Alternatively, you can keep your Camel app running and use a Quartz endpoint
to do cron-like scheduling http://camel.apache.org/quartz.html

Cheers,
Jon

On Fri, Mar 11, 2011 at 12:14 PM, kanmisc <[email protected]> wrote:

> Hi All
>
> I have a requirement of monitoring my system and it is implemented with the
> help of camel sending messages often to different ports and checks for
> system status. When i developed, i used mvn camel:run command and executed
> the camel routes to send messages.
>
> But now i have to automate it by executing this camel functionality from
> unix cron. For this i have written a junit test which is called from cron
> and it triggers the camel to send messages every hour. it starts and sends
> messages fine but I am not able to shutdown the camel completely. I tried
> shutdown strategy but it is not getting shut down.
>
> Please provide suggestions -
> 1) Is it ok to call camel like this from a test class? Or is it possible to
> execute camel from unix cron directly?
> 2) How to shutdown the camel (i.e until next triggering of messages so that
> no resource consumption)
>
> Thanks in advance.
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Shutting-down-camel-from-a-test-tp3425270p3425270.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Cheers,
Jon
---------------
FuseSource
Email: [email protected]
Web: fusesource.com
Twitter: jon_anstey
Blog: http://janstey.blogspot.com
Author of Camel in Action: http://manning.com/ibsen

Reply via email to