Check http://camel.apache.org/producertemplate.html
You can call the direct:start endpoint with it.

Christian

On 12.12.2014 07:12, niteshjain wrote:
how to invoke a Router in Camel context via a Java code.
Tried this -

in Java Class :

ApplicationContext context = new
ClassPathXmlApplicationContext("*camel_context.xml*");
CamelContext camel = SpringCamelContext.springCamelContext(context);
camel.startRoute("*firstRoute*");
in camel_context.xml :

<bean id=&quot;&lt;b>testRoute*"
class="org.apache.camel.processor.RouterTest"/>

<camelContext trace="false" id="TestRouterCamel"
         xmlns="http://camel.apache.org/schema/spring";>

        <route id=&quot;&lt;b>firstRoute*">
                <from uri="direct:start" />
                <to uri=&quot;&lt;b>testRoute*" />
      </route>
</camelContext>

Trying to invoke firstRoute in camel_context.xml via java class. any help
would be appreciated.

Thanks in advance.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Invoking-a-Router-via-Java-Processor-tp5760612.html
Sent from the Camel Development mailing list archive at Nabble.com.


--
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com

Reply via email to