camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrei Shakirin <ashaki...@talend.com>
Subject RE: Producer template in camelContext seems not to be registered as bean in Blueprint context
Date Tue, 16 Sep 2014 12:56:57 GMT
Hi,

The issue was resolved, nothing to do with Camel.
It was my error: missing setter in class where template is injected.
Sorry for spamming :)

Regards,
Andrei.

> -----Original Message-----
> From: Andrei Shakirin [mailto:ashakirin@talend.com]
> Sent: Dienstag, 16. September 2014 14:21
> To: users@camel.apache.org
> Subject: Producer template in camelContext seems not to be registered as bean
> in Blueprint context
> 
> Hi,
> 
> I have defined producer template in Camel context using spring. The producer
> is registered in spring as a bean and can be injected:
> 
>     <camelContext id="articleServiceContext" trace="false"
> xmlns="http://camel.apache.org/schema/spring">
>         <template id="producerTemplate" />
>         <routeBuilder ref="myRoute" />
>     </camelContext>
> 
> ...
> 
> public class MyClass {
> 
>     @Autowired
>     private ProducerTemplate producerTemplate; ...
> }
> 
> This works fine. Now I would like to do the same using blueprint in OSGi
> environment:
> 
> <blueprint
>     default-activation="eager"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xmlns:camel="http://camel.apache.org/schema/blueprint">
> 
>    <camelContext id="articleServiceContext" trace="false"
> 		xmlns="http://camel.apache.org/schema/blueprint">
> 
>         <template id="producerTemplate" />
>         <routeBuilder ref="myRoute" />
>    </camelContext>
> 
>   <bean id="myBean" class="test.MyClass">
>     <property name="producerTemplate" ref="producerTemplate" />
>   </bean>
> 
> </blueprint>
> 
> The injection into myBean doesn't work, producerTemplate bean is unknown in
> blueprint context.
> 
> Question: is creating of the producerTemplate programmatically only solution
> in blueprint or is there other syntax to register producer template as a bean?
> 
> Regards,
> Andrei.

Mime
View raw message