java - How to trigger task after getting camelcontext? -
i new apache camel framework.i have inject below camelcontext bean(i.e id camel) creationimpl , able access endpoints , routes camelcontext object. want know how trigger task. don't know whether correct way? please suggest.
<camel:camelcontext id="camel"> <camel:jmxagent id="agent" createconnector="true" useplatformmbeanserver="true" connectorport="1516" registryport="1515" /> <camel:endpoint id="email" uri="${email}" /> <camel:route errorhandlerref="createerrorhandler" id="createroute"> <camel:from uri="direct:startreading"/> <camel:dotry> <camel:bean ref="creationprocessor" method="method1"/> <camel:bean ref="creationfilter" method="method2"/> <camel:bean ref="creatorfeedback" method="method3"/> <camel:bean ref="creatorfeedback" method="method4"/> <camel:docatch> <camel:exception>java.lang.exception</camel:exception> <camel:bean ref="creatorfeedback" method="method5"/> </camel:docatch> </camel:dotry> </camel:route> </camel:camelcontext> public class creationimpl{ private camelcontext camelcontext; public void migrate{ //how trigger route after getting camelcontext object } }
thanks in advance.
getcamelcontext().stoproute("cmpcreatorroute"); getcamelcontext().startroute("cmpcreatorroute");
will trick.
Comments
Post a Comment