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.

Reply via email to