Hello,
I was looking for using @Produce and @EndpointInject annotations without
using Spring XML, but at the beginning with no success, my producer was null
all the time.
So after many and many runs of my application with differents CamelContext
parameters, i've found some which works perfect for me.
So I decided to share it because the online documentation dont explain
anywhere how to do that.

Maybe a shorter solution can be found.

So, now the Java code:

StaticApplicationContext ctx = new StaticApplicationContext();
SpringCamelContext camelContext =
SpringCamelContext.springCamelContext(ctx);
CamelBeanPostProcessor proc = new CamelBeanPostProcessor();
proc.setApplicationContext(ctx);
proc.setCamelContext(camelContext);     
ctx.getBeanFactory().addBeanPostProcessor(proc);
camelContext.addRoutes(...);
camelContext.start();


-- 
View this message in context: 
http://www.nabble.com/TIPS%3A-HowTo-Use-Producer-annotations-with-java-DSL-only-%28no-xml%29-tp21916074s22882p21916074.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to