Re: Invoking Dynamic OSGi Blueprint services from a Java RouteBuilder

2016-01-28 Thread Quinn Stevenson
Thank you Ranx - Unfortunately, I haven’t figured out a way to get around using RouteBuilders for my use case. Since I have a few very common patterns for my routes where the only differences are endpoint configurations and a few other minor things, I can create a few common RouteBuilders and

Re: Invoking Dynamic OSGi Blueprint services from a Java RouteBuilder

2016-02-01 Thread Ranx
I think in my case the problem was with how the package scan is working but I'm not positive. In the Camel Core OSGi package scanner class there is a section. If it can find it in OSGi it shrugs, throws up its hands and resorts to brute force classloading. Instead of getting hard error Camel was

Re: Invoking Dynamic OSGi Blueprint services from a Java RouteBuilder

2016-02-01 Thread Ranx
By the way, while I realize this is in there for older JBI constructs this is what I meant when asking if there is a way that a "strict" flag could be added. Perhaps that's a question I should post on the developers forum. Even if by default the flag was false, being able to set it to true and

Re: Invoking Dynamic OSGi Blueprint services from a Java RouteBuilder

2016-02-02 Thread Christian Schneider
There is a much simpler way to use an OSGi service with blueprint. Simply use the bean component of camel. It resolves beans against the camel registry. When you define your camel context using blueprint then the camel registry automatically includes all blueprint beans. So you can do this in

Re: Invoking Dynamic OSGi Blueprint services from a Java RouteBuilder

2016-02-02 Thread Brad Johnson
Christian, Thanks for the constructive thoughts. Theoretically if everything is set up correctly then it will find everything in the OSGi registry. Unfortunately, when it can't find things in the registry it will look for it with the global class loader. That was happening to me. It shouldn't ha

Re: Invoking Dynamic OSGi Blueprint services from a Java RouteBuilder

2016-02-02 Thread Christian Schneider
I agree about the classloader hacks ... though I am not sure if they are needed anywhere. The approach I showed will not suffer from this problem as you directly tell it to get a bean with an id. Christian On 02.02.2016 17:24, Brad Johnson wrote: Christian, Thanks for the constructive though

Re: Invoking Dynamic OSGi Blueprint services from a Java RouteBuilder

2016-02-02 Thread Quinn Stevenson
Thank You Christian - Yes - I pointed out that if I used the Bean Component, everything seemed to work as I expected. The problem I have is I use beans in filter blocks as well, and there I can’t use the 'to( “bean://” ) with an aggregation strategy to get around this, but it worked the same

Re: Invoking Dynamic OSGi Blueprint services from a Java RouteBuilder

2016-02-02 Thread Brad Johnson
https://issues.apache.org/jira/browse/CAMEL-9562 I've opened an issue. I think it is a relatively easy thing to add a strict mode flag without breaking anyone. You're right that it is easy enough to make it work right. But if I haven't set something up to work correctly I don't want the classlo

Re: Invoking Dynamic OSGi Blueprint services from a Java RouteBuilder

2016-02-02 Thread Quinn Stevenson
Thank You for opening the issue Brad - You beat me to it, but you’re explanation of the issue was much better than I could come up with - all I have are samples of what’s going on and no real explanation as to why :-) Thanks Again > On Feb 2, 2016, at 9:51 AM, Brad Johnson wrote: > > https

Re: Invoking Dynamic OSGi Blueprint services from a Java RouteBuilder

2016-02-02 Thread Brad Johnson
Tack the examples on to the issue to give it context.. That'll help folks replicate it. On Tue, Feb 2, 2016 at 11:01 AM, Quinn Stevenson < qu...@pronoia-solutions.com> wrote: > Thank You for opening the issue Brad - > > You beat me to it, but you’re explanation of the issue was much better > tha

Re: Invoking Dynamic OSGi Blueprint services from a Java RouteBuilder

2016-02-02 Thread Quinn Stevenson
Will do - I’ll pull them from this thread. Thanks Again - this one is killing me right now > On Feb 2, 2016, at 10:02 AM, Brad Johnson > wrote: > > Tack the examples on to the issue to give it context.. That'll help folks > replicate it. > > On Tue, Feb 2, 2016 at 11:01 AM, Quinn Stevenson

Re: Invoking Dynamic OSGi Blueprint services from a Java RouteBuilder

2016-02-02 Thread Brad Johnson
And if we get enough up votes maybe it'll get put in. It shouldn't be too difficult technically and can be put in without breaking anyone. Now, what happens when the flag gets turned on will be interesting. On Tue, Feb 2, 2016 at 11:02 AM, Brad Johnson wrote: > Tack the examples on to the issu

Re: Invoking Dynamic OSGi Blueprint services from a Java RouteBuilder

2016-02-02 Thread Quinn Stevenson
Do you have an idea of how to fix this? If you can point me in the right direction, I’d be happy to get a PR going for it. Quinn Stevenson qu...@pronoia-solutions.com (801) 244-7758 > On Feb 2, 2016, at 10:05 AM, Brad Johnson > wrote: > > And if we get enough up votes maybe it'll get put i

Re: Invoking Dynamic OSGi Blueprint services from a Java RouteBuilder

2016-02-02 Thread Christian Schneider
I am actually not sure if you have a classloader problem here. In your original route you use: .bean(blueprintServiceReference,false) public void setBlueprintServiceReference(Echo blueprintServiceReference) { this.blueprintServiceReference = blueprintServiceReference; } This will simpl

Re: Invoking Dynamic OSGi Blueprint services from a Java RouteBuilder

2016-02-02 Thread Quinn Stevenson
Christian - I don’t know about a class loader issue, but I do know when I run the route configured as you have it below, I’m not getting a proxy to the service. I know this because if I stop the bundle containing the OSGi service, the Camel context keeps running - I don’t get a ServiceUnavaila

Re: Invoking Dynamic OSGi Blueprint services from a Java RouteBuilder

2016-02-02 Thread Christian Schneider
On 02.02.2016 23:08, Quinn Stevenson wrote: Christian - I don’t know about a class loader issue, but I do know when I run the route configured as you have it below, I’m not getting a proxy to the service. I know this because if I stop the bundle containing the OSGi service, the Camel context

Re: Invoking Dynamic OSGi Blueprint services from a Java RouteBuilder

2016-02-02 Thread Quinn Stevenson
> On Feb 2, 2016, at 3:15 PM, Christian Schneider > wrote: > > On 02.02.2016 23:08, Quinn Stevenson wrote: >> Christian - >> >> I don’t know about a class loader issue, but I do know when I run the route >> configured as you have it below, I’m not getting a proxy to the service. I >> know t

Re: Invoking Dynamic OSGi Blueprint services from a Java RouteBuilder

2016-02-02 Thread Quinn Stevenson
I would expect the CamelContext to keep trying to run as well, but I expected it to hit the call to the OSGi service, block, and then timeout and throw a ServiceUnavailableException. But what I’m seeing is the call to the OSGi service is completing (it’s basically and echo service right now), a

Re: Invoking Dynamic OSGi Blueprint services from a Java RouteBuilder

2016-02-02 Thread Christian Schneider
I would use a new issue that just explains what happens without trying to interpret. We do not yet know what really happens but I hope we can find out. Christian 2016-02-03 3:40 GMT+01:00 Quinn Stevenson : > I would expect the CamelContext to keep trying to run as well, but I > expected it to hi

Re: Invoking Dynamic OSGi Blueprint services from a Java RouteBuilder

2016-02-05 Thread Quinn Stevenson
OK - I’ve created an new JIRA issue describing what I’m seeing. https://issues.apache.org/jira/browse/CAMEL-9570 I’ll extract some samples from my projects and add them to the ticket shortly. > On Feb 3, 2016, at 12:05 AM, Christian Schneider

Re: Invoking Dynamic OSGi Blueprint services from a Java RouteBuilder

2016-02-05 Thread Brad Johnson
Quinn, If you wouldn't mind putting a reference in there as a "may be related to" the other issue that would be great. There shouldn't be a reason in an OSGi environment for any classloaders grabbing concrete implementations from other bundles and the current Camel classloader mechanics explicitl

Re: Invoking Dynamic OSGi Blueprint services from a Java RouteBuilder

2016-02-05 Thread Quinn Stevenson
Brad - Please feel free to associate the issues - I don’t know exactly how that’s supposed to be done (I’m a little new to the Apache JIRA process). - Quinn > On Feb 5, 2016, at 2:10 PM, Brad Johnson wrote: > > Quinn, > > If you wouldn't mind putting a reference in there as a "may be relat

Re: Invoking Dynamic OSGi Blueprint services from a Java RouteBuilder

2016-02-18 Thread Quinn Stevenson
This one is really killing me. If anyone has any idea what may be going on and can point me in the right direction, I’d love to take a shot at fixing it - I just don’t know where to start looking. > On Feb 3, 2016, at 12:05 AM, Christian Schneider > wrote: > > I would use a new issue that

Re: Invoking Dynamic OSGi Blueprint services from a Java RouteBuilder

2016-02-18 Thread Brad Johnson
Quinn, I don't recall if you answered this or not but when you run this: On Thu, Feb 18, 2016 at 9:18 AM, Quinn Stevenson < qu...@pronoia-solutions.com> wrote: > This one is really killing me. > > If anyone has any idea what may be going on and can point me in the right > direction, I’d love t

Re: Invoking Dynamic OSGi Blueprint services from a Java RouteBuilder

2016-02-18 Thread Brad Johnson
When you run this below where you inject the blueprintServiceReference into the routebuilder, have you tried do a blueprintServiceReference.getClass().getName() log of print out? You should see the com.sun.Proxy class and not a concrete class. That's when I knew something was wrong for me. But I

Re: Invoking Dynamic OSGi Blueprint services from a Java RouteBuilder

2016-02-19 Thread Quinn Stevenson
No - I haven’t tried logging the class type. I know it’s not a proxy because I don’t get a ServiceTimeoutException when the service is unavailable. I guess it could be a broken proxy, but I doubt it. I’ll try a couple of things and post my results. > On Feb 18, 2016, at 3:24 PM, Brad Johnson

Re: Invoking Dynamic OSGi Blueprint services from a Java RouteBuilder

2016-02-19 Thread Brad Johnson
Good point. I guess I was just running through in my head what I did when I ran into the problem. There's definitely a classloader difference depending on how the routes and injection get set up. I have some speculations about it but that's all. I wish I had more time to chase it down. On Fri,

RE: Invoking Dynamic OSGi Blueprint services from a Java RouteBuilder

2016-01-26 Thread Siano, Stephan
Hi, You have actually two issues. The first Is accessing an OSGi service from a route using Java DSL. Camel lookups are done in a Camel registry. The kind of registry depends on the way you start your camel context, if you are using blueprint to do that, you have a blueprint registry, if you ar

RE: Invoking Dynamic OSGi Blueprint services from a Java RouteBuilder

2016-01-26 Thread Siano, Stephan
@camel.apache.org Subject: RE: Invoking Dynamic OSGi Blueprint services from a Java RouteBuilder Hi, You have actually two issues. The first Is accessing an OSGi service from a route using Java DSL. Camel lookups are done in a Camel registry. The kind of registry depends on the way you start your camel context

Re: Invoking Dynamic OSGi Blueprint services from a Java RouteBuilder

2016-01-27 Thread Quinn Stevenson
are using > option 3, which should actually work as you expected. > > Best regards > Stephan > > -Original Message- > From: Siano, Stephan [mailto:stephan.si...@sap.com] > Sent: Mittwoch, 27. Januar 2016 07:40 > To: users@camel.apache.org > Subject: RE: I

Re: Invoking Dynamic OSGi Blueprint services from a Java RouteBuilder

2016-01-27 Thread Ranx
This is serendipitous as I've recently run into this as well. I switched from straight Blueprint routes and instantiation to using blueprint to bootstrap the routebuilder(s). But the injection of the reference to the service from blueprint doesn't appear to be proxied as I see the concrete class

Re: Invoking Dynamic OSGi Blueprint services from a Java RouteBuilder

2016-01-27 Thread Quinn Stevenson
I’m not using the annotations, but it sounds like the same issue. I tried something else that seems to work - if I use the Bean Component ( http://camel.apache.org/bean.html ), everything seems to be working as I’d expect. So if I change my RouteBuilder to lo

Re: Invoking Dynamic OSGi Blueprint services from a Java RouteBuilder

2016-01-27 Thread Ranx
I've reverted to using blueprint.xml for any service reference calls and limiting the routebuilders for now. The part I found most disconcerting about this was that the implementation class was being found since it should be hidden. That means the classloader is pulling it from a bundle and provi