[ 
https://issues.apache.org/jira/browse/CAMEL-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15302561#comment-15302561
 ] 

Quinn Stevenson commented on CAMEL-9570:
----------------------------------------

Thank You Claus -

I was going to reach out to the other teams, but I'm pretty sure this problem 
is in Camel - not Blueprint of Karaf.

The reason I say that is I tried to replicate the issue using a plain Blueprint 
XML, and I couldn't.  The plain blueprint initialized a simple bean the same 
way I initialize a the route builder in the Camel Blueprint XML, and then 
started a thread that called the bean periodically (just like the timer-driver 
java RouteBuilder does).  With this configuration, I couldn't reproduce the 
issue.

I then put the plain blueprint XML in the same bundle as the Camel blueprint 
XML, and found that the plain blueprint XML was effected by the Camel Blueprint 
XML.  When the component in the plain blueprint XML called the service via the 
proxy (obtained from the blueprint container), it behaved exactly the same way 
as the Camel blueprint XML.  I also tried this when the route in the route 
builder was not auto-started, and that had no effect (i.e. I still didn't get 
the new service, and the original instance of the service is continued to be 
called even though the bundle exporting that service has been stopped)

Then I tried the bundle with both blueprint XMLs, but I did NOT put the route 
builder in the camel context.  In this situation, the component in the plain 
blueprint XML behaved as expected.

Based on all of this, it looks to me like the blueprint proxy is being modified 
when the camel context is initialized.  Either that Camel is effecting the way 
the proxy is created before it is put in the blueprint context.

If you can you point me to the right spot in the code where this type of 
initialization occurs, I'd be very grateful.  I've spent many hours tracing 
through the camel code in a debugger, be I get lost in all the dynamic proxies 
and reflection manipulations - I'm not sure where to focus.

> Blueprint Proxies are not used when injected into Java RouteBuilders
> --------------------------------------------------------------------
>
>                 Key: CAMEL-9570
>                 URL: https://issues.apache.org/jira/browse/CAMEL-9570
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-blueprint, camel-core
>    Affects Versions: 2.16.2
>            Reporter: Quinn Stevenson
>            Assignee: Christian Schneider
>
> Basic Conditions:
> - Java interface used for OSGi Services
> - Implementation of the Java interface registered as a OSGi service.  Note 
> that the package containing implementation is NOT exported
> - A Java RouteBuilder that uses the Java interface via bean(...) DSL calls, 
> with a setter for the bean implementing the interface
> - Wire everything together with Blueprint - create a <reference ...> for the 
> service, a <bean ...> for the RouteBuilder and inject the service reference, 
> and use the RouteBuilder in a CamelContext.
> After all this is deployed, stop the bundle implementing the service.  A 
> ServiceUnavailableException should be thrown after a timeout, but the object 
> that was injected into the RouteBuilder process the request - so the 
> Blueprint Proxy is not used.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to