camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: "simple programatic" camel and OSGi
Date Tue, 05 Aug 2014 13:24:34 GMT
Use OsgiDefaultCamelContext from camel-core-osgi and use the
OsgiCamelContextHelper to hook it into the osgi world, as it does
setup a bunch of stuff.






On Tue, Aug 5, 2014 at 2:50 PM, Matt Sicker <boards@gmail.com> wrote:
> If you're not using Blueprint, then this is how you need to do it:
>
> 1. Create the Component instance somewhere (like a BundleActivator).
> 2. Register it as a service with at least the attribute "name" = "rabbitmq".
> 3. Now it's available from the default OSGi Camel registry!
>
> This is actually a point in Camel where I've been thinking about working on
> improved support. If you use Declarative Services, for example, then you
> still need to add in some custom overriding code in a CamelContext
> implementation in order to look up said services.
>
>
> On 5 August 2014 04:47, apanday <apanday@apache.org> wrote:
>
>> Hi all,
>>
>> I have a fairly good understanding of OSGi, not so much of Camel internals.
>> I'm trying to start a simple camel route involving rabbitmq in an OSGi
>> container (simple file -> camel).
>> (and incidentally I'm using the scala DSL, and camel version 2.13.2, inside
>> a simple felix container)
>>
>> My problem is (what seems to be) the usual:
>> Failed to resolve endpoint: rabbitmq://localhost/... due to: No component
>> found with scheme: rabbitmq
>>
>> I would like to understand in "simple programatic terms" how these custom
>> endpoints get wired to the camel context, in an OSGi container.
>> By "simple" i mean, please no answer in the lines of "just use
>> karaf+spingdm+eclipse+maven+..." I know i'm missing something trivial, yet
>> i
>> don't want to obfuscate my problem under a pile of libraries.
>> If someone could help before i dive too deep into the camel source code.
>> My understanding is that the camel-osgi bundle tracks starting bundles and
>> scans them for camel components, then registers the components to the
>> service registry (and maybe somewhere in camel).. yet it doesn't seem to
>> quite work this way.
>>
>>
>> This has been my approach so far:
>>
>> step 0: simply define the route in my activator
>>
>> => Failed to resolve endpoint
>>
>> step 2: add a dependency on the rabbitmq ComponentResolver (i noticed in
>> the
>> webconsole that it was registered)
>>
>> => "got the rabbit" prints ok, but camel still Failed to resolve endpoint
>>
>> step 3: explicitely resolve the rabbit in my context
>>
>> => "got the rabbit" prints ok and resolve doesn't fail, but camel still
>> Failed to resolve endpoint
>>
>> Many thanks,
>> Arjun
>>
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/simple-programatic-camel-and-OSGi-tp5754790.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>
>
> --
> Matt Sicker <boards@gmail.com>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Mime
View raw message