[
https://issues.apache.org/jira/browse/CAMEL-9570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15302841#comment-15302841
]
Quinn Stevenson commented on CAMEL-9570:
----------------------------------------
The basic versions of the source are in this JIRA at the top, but I just push
the current incarnation of my testing components to GitHub (
https://github.com/hqstevenson/example-camel-osgi-service-testing ).
As far a I know, this has been there forever. I first noticed some strange
behavior with Camel 2.12 (at least that's what I remember), but I didn't ever
track down exactly what was going on until Camel 2.16.
I actually have a bunch of blueprint files. There are three bundles that make
up the services I'm using for testing - one that contains the java interface
for the service and two that have implementations of the service. I recently
moved the basic implementation of the service into and abstract class in the
service interface bundle (because I got tired of changing code twice every time
I wanted the service implementations to log something more/different), but that
didn't have any effect on the behavior. The service implementations from the
two bundles are exposed using a blueprint file in each bundle, and the
implementing classes are not exported from the bundle.
The bundle containing the camel consumer has three blueprint files in it. One
defines the service references (used by the other two), one defines the camel
context and configures the route builder, and the final one configures a plain
java object to call the same service (i.e. no Camel involved).
If you clone the project, you'll see another bundle as well - it has a
blueprint that doesn't use camel that calls services (similar to the camel
bundle, just without camel). I was trying to reproduce the behavior with this
bundle, but I couldn't.
> 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)