Hi,

You can declare any kind of beans with @Produces. Whenever Camel looks up for a 
named bean via the Camel registry, it will retrieve a reference to the 
corresponding named bean declared with @Produces.

In your example below, what exactly does not work with the produceConfig 
producer method? Is it normal that the method return null? Note that the 
producer method will actually be invoked only if a reference to it is needed, 
for example if a Camel route refers to it.

Antonin

> On 05 May 2016, at 14:07, kalber <karlheinz.al...@swslt.com> wrote:
> 
> Hi,
> 
> i'm trying to create managed beans with @Producer, but only for
> PropertiesComponent
> works. In the example below method prodceProperties works,  produceConfig
> not.
> 
> Is there a limitation under camel for @Producer ?
> 
> 
> @ApplicationScoped
> public class TestProducer {
> 
>    @Produces
>    @Named("prop")
>    public PropertiesComponent produceProperties() {
>        System.out.println("Produces Properties");
>        return null;
>    }
> 
>    @Produces
>    @Named("not-prop1")
>    public MyBean produceConfig() {
>        System.out.println("Not Properties");
>        return null;
>    }
> 
> }
> 
> 
> 
> -----
> kh
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-2-17-Producer-works-only-for-select-objects-tp5782226.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to