Hi
If you are in a Spring bean, you can just inject the CamelContext or the
ProducerTemplate into the Spring bean without retrieving the using
ApplicationContext.
Regards
Krzysztof
On 21.12.2014 06:50, niteshjain132 wrote:
> Context.xml is in the same bundle,
> how can i access the beans without loading via ApplicationContext.
>
> i'm trying this -
>
> ApplicationContext ac = new
> ClassPathXmlApplicationContext("META-INF/spring/camel_spring-ws.xml");
> CamelContext context = ac.getBean("camel",CamelContext.class);
>
> Exchange myExchange = new DefaultExchange(context);
> exchange.getIn().setBody("Hello");
>
> ProducerTemplate template = context.createProducerTemplate();
> template.send("direct:start", myExchange);
>
> to invoke a router defined in camelContext.xml
>
>
>
> --
> View this message in context:
> http://servicemix.396122.n5.nabble.com/The-XML-doesn-t-validates-in-ServiceMix-tp5721993p5722010.html
> Sent from the ServiceMix - Dev mailing list archive at Nabble.com.
--
Krzysztof Sobkowiak
JEE & OSS Architect | Senior Solution Architect @ Capgemini | Committer
@ ASF
Capgemini <http://www.pl.capgemini.com/> | Software Solutions Center
<http://www.pl.capgemini-sdm.com/> | Wroclaw
e-mail: [email protected] <mailto:[email protected]> |
Twitter: @KSobkowiak
Calendar: http://goo.gl/yvsebC