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

ASF GitHub Bot commented on CAMEL-9570:
---------------------------------------

GitHub user hqstevenson opened a pull request:

    https://github.com/apache/camel/pull/1269

    CAMEL-9570:  Blueprint service proxies aren't used

    This PR has two main pieces.  First, the CamelDependenciesFinder was 
removed from the CamelNamespaceHandler.  This code caused the issue described 
in CAMEL-9570 as well as CAMEL-10394.  The net effect of removing this class is 
the CamelContext may attempt to start when a service isn't available because 
the reference hasn't been specified in the XML.  This is better than what 
happens today which is service references sometimes get registered for services 
that don't exist - therefore, starting Blueprint Context times-out waiting for 
service references.  This one actually bit me 18-mo ago with a customer - I'm 
just didn't know at the time what was causing it.
    
    The second piece of the PR is changing the BlueprintCamelContext so it 
starts after the BlueprintContainer is created (on the BlueprintEvent.CREATED). 
 This fixes some startup issues.  Basically what was happening is if the 
serviceChanged method (which previously was used to start the camel context) 
threw a RuntimeException, the Karaf container would spin until a stack overflow 
occurred.  I didn't see this behavior when the context is started after the 
BlueprintContainer is fully initialized.
    
    The only thing I changed in the CamelContextFactoryBean was removing a 
space that caused a Checkstyle error.
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/hqstevenson/camel CAMEL-9570

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/camel/pull/1269.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1269
    
----
commit 0376e45defaaa70e4795dcc8ef54905025568a79
Author: Quinn Stevenson <[email protected]>
Date:   2016-11-14T16:09:10Z

    CAMEL-9570: Remove CamelDependenciesFinder from CamelNamespaceHandler

commit 57d92619ac62655eafe9434e2149616f025c21df
Author: Quinn Stevenson <[email protected]>
Date:   2016-11-14T16:29:49Z

    CAMEL-9570: Start BlueprintCamelContext on BlueprintEvent.CREATED

commit c4a7e820be90c5101cef2b04aa5d057e6820b57e
Author: Quinn Stevenson <[email protected]>
Date:   2016-11-14T16:30:16Z

    Fix checkstyle issue

----


> 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