Hi all,

I am seeing some strange behaviour with a very basic spring/camel
application... can anyone help me understand this?:

I have defined a spring bean for camelContext with one route (with
autoStartup="true") and when the bean is created, a thread will be created
which listens for incoming messages...

In my static void main method, I am simply initialising the application
context:
new ClassPathXmlApplicationContext("application-context.xml");

If I do this, the camelContext initialises successfully but then the
application terminates immediately.  However, if I add a Thread.sleep(2000)
after initialising the application-context,  then the application never
terminates (because there is a thread listening for incoming messages)....
this is what I expected to happen - but why do I need to have a
Thread.sleep ?

Thanks for any help,
Josh

Reply via email to