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

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

A couple of more updates on this -

I tried removing the OsgiServiceRegistry from the camel context - no effect

I also tried this with another Blueprint that doesn't use camel but uses the 
same service reference - all in the same bundle.  

<bean id="blueprint-consumer" 
class="com.pronoia.osgi.blueprint.BlueprintServiceConsumer" init-method="start" 
destroy-method="stop">
    <property name="service" ref="osgi-service" />
</bean>

The BlueprintServiceConsumer starts a timer and calls the injected service - 
nothing else.

The net of this is when the blueprint bundle behaves the same way as the camel 
bundle - i.e. when the service reference is injected into the route builder, 
the POJO in the blueprint bundle won't pickup new services either.  

I then removed the routebuilder from the camel context and tried again - this 
time the blueprint consumer works as expected.

So it appears that the service proxy is being modified somehow when the 
routebuilder is initialized in by the camel context?

Still digging - but this is strange

> 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