Hi,
I used to have a working system using Spring-OSGi, XML configs and Camel
2.5 and I thought it would be great to upgrade to the latest version for all
those components. So I am now using Gemini Blueprint (replacement for
Spring-OSGi), Spring Java config to get rid of XML and Camel 2.10.1. I have
converted every XML file to be @Configuration classes with RouteBuilders,
which I think is great, but now I am having problems injecting a
CamelContext and ProducerTemplates. That will just not work at all. I must
be missing something...
For example:
public class MyConfig extends SingleRouteCamelConfiguration implements
CamelContextAware
{
@Value("input")
private String input;
@Autowired
private Factory myFactory;
@EndpointInject(uri="seda:aQueue")
private ProducerTemplate producer1;
@Produce(uri="seda:aQueue")
private ProducerTemplate producer2;
private CamelContext camelContext; // with appropriate getter/setter
...
}
input and myFactory are injected with values, but producer1, producer2 and
camelContext are not.
I am using Equinox and Eclipse Gemini Blueprint Extender, camel-core,
camel-spring, camel-spring-javaconfig as well as one XML support file (that
does get loaded):
<beans>
<context:annotation-config/>
<context:component-scan base-package="*"/>
<context:property-placeholder location="classpath:config.properties"/>
</beans>
I have no camelContext declared anywhere. My routes are declared and
created with @Configuration classes returning RouteBuilders (this part works
well).
In summary, everything works well beside Camel annotations (@Produce,
@EndpointInject and CamelContextAware interface, which should inject a
CamelContext from my understanding). What am I not declaring/not starting
right?
Thanks!
--
View this message in context:
http://camel.465427.n5.nabble.com/Issue-with-Camel-annotations-not-being-processed-OSGi-Blueprint-Javaconfig-tp5718606.html
Sent from the Camel - Users mailing list archive at Nabble.com.