Hi,
    I have a simple XML file:

<beans xmlns="http://www.springframework.org/schema/beans";
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
       xmlns:camel="http://camel.apache.org/schema/spring";
       xsi:schemaLocation="
         http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
         http://camel.apache.org/schema/spring 
http://camel.apache.org/schema/spring/camel-spring.xsd";>


        <camel:camelContext autoStartup="false">
           <camel:route autoStartup="false" shutdownRoute="Defer">
                <camel:from uri="file:data/inbox/file" />
                <camel:to uri="file:data/outbox/" />
           </camel:route>
        </camel:camelContext>
</beans>


which I load from my Java Program using ApplicationContext, the code is below:

{
        ApplicationContext context = new ClassPathXmlApplicationContext(new 
String[]{"routes1.xml"});
            CamelContext camel = SpringCamelContext.springCamelContext(context);
            System.out.println(camel.getName());
            camel.start();
            Thread.sleep(10000);
            camel.stop();

}


Though for some reasons it does not execute the route specified in the 
CamelContext. The file never gets copied. Though I am sure the context is 
getting created inside the Java Program. Do I need some additional 
configuration parameters to make sure the route defined in the CamelContext 
gets started?


Regards,
Gaurav

Reply via email to