Babak's link should help. That is useful mostly when you run manually
using something like camel:run. Another option is to wait for an event
after context.start() and at the end of your processing trigger the
event. That way your wait time will be no longer than needed.
Cheers,
Hadrian
On 02/03/2012 06:47 PM, Babak Vahdat wrote:
Hi
Starting Camel context (context.start()) does *not* block the main thread.
However when you do a Thread.sleep() you give a chance to the daemon thread
to run the file consumer polling inside, eg 1 polling round, and as it's a
daemon thread it doesn't block the JVM from exiting so that your JVM exits
at the end!
You can take a look at [1] to see how you can keep your Camel standalone
application running.
[1]
http://camel.apache.org/running-camel-standalone-and-have-it-keep-running.html
Babak
--
View this message in context:
http://camel.465427.n5.nabble.com/File-consumer-waiting-for-it-to-start-tp5455062p5455435.html
Sent from the Camel - Users mailing list archive at Nabble.com.
--
Hadrian Zbarcea
Principal Software Architect
Talend, Inc
http://coders.talend.com/
http://camelbot.blogspot.com/