<bean id="camelRouteManager" class="com.multiplecamel.CamelRouteManager" >
        <property name="camelContext" ref="camelContext-local"></property>
        </bean>
        
                <camelContext id="camelContext-local"
xmlns="http://camel.apache.org/schema/spring";>
                
                        <routeBuilder ref="camelRouteManager" /> 
                
                         <route id="route1" autoStartup="false">
                    <from uri="timer://testJob?fixedRate=true&amp;period=5000" 
/>           
                    <to uri="bean:test?method=sendTrap" />
            </route>
             
                </camelContext>

above is the spring dsl file defined in camel-confif.xml in web
application.it will be loaded during startup.

I try to get the route id information in CamelRouteManager using
camelContext.getRoute("route1") but its coming as null.if I use
getRouteDefinition then route definition is coming.  
                
public class CamelRouteManager extends RouteBuilder  {
        
        protected CamelContext camelContext;

        public CamelContext getCamelContext() {
         return camelContext;
        }
        public void setCamelContext(CamelContext camelContext) {
         this.camelContext = camelContext;

        }

        @Override
        public void configure() throws Exception {
                System.out.println(camelContext.getName()+"  
auotstartup:::::"+camelContext.isAutoStartup());
                System.out.println(camelContext.getRouteDefinition("route1")+" 
... 
routes::::"+camelContext.getRoute("route1"));
                
                
        }
        
        

}



--
View this message in context: 
http://camel.465427.n5.nabble.com/route-information-is-not-coming-with-camelContext-getRoute-route1-tp5758371.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to