Re: Camel 2.17, @Producer works only for select objects ?

2016-05-06 Thread kalber
Thanks, it's not a camel problem but simply my CDI ignorance. MyBean is never used or better Injected, consequence producer is not triggerd. Now i understand what's lazy loading is in CDI. - kh -- View this message in context: http://camel.465427.n5.nabble.com/Camel-2-17-Producer-works-

Re: How to use cdi annotation to reference shared netty server in karaf?

2016-05-06 Thread Antonin Stefanutti
Hi Leon, In order to get the NettySharedHttpServer service exposed as a named bean in your Java DSL bundle, you could do: @ContextName("sample") public class SampleRoute extends RouteBuilder { @Inject @OsgiService private NettySharedHttpServer server; @Produces @Named("sharedNettyH

Re: Camel 2.17, @Producer works only for select objects ?

2016-05-06 Thread Antonin Stefanutti
> On 06 May 2016, at 10:21, kalber wrote: > > -- In your example below, what exactly does not work with the produceConfig > producer method? > Simply 'System.out.println("Not Properties")' not executed. CDI beans are lazy-produced, that is the producer methods are only executed if instances o

Re: Camel 2.17, @Producer works only for select objects ?

2016-05-06 Thread kalber
-- In your example below, what exactly does not work with the produceConfig producer method? Simply 'System.out.println("Not Properties")' not executed. -- Is it normal that the method return null? It's only a test, wanna see if ' 'System.out.println("Not Properties")' works. So there is a limit

Re: Camel 2.17, @Producer works only for select objects ?

2016-05-06 Thread Antonin Stefanutti
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?