camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: Using Camel with Felix (Karaf) without Spring
Date Fri, 27 Nov 2009 15:29:40 GMT
Just a quick answer for reusing the OSGi service.
Camel 2.x support to use the OSGi service name as the BeanComponent's 
reference.

You can find the code here[1]

[1]https://svn.apache.org/repos/asf/camel/trunk/components/camel-osgi/src/main/java/org/apache/camel/osgi/OsgiServiceRegistry.java



Willem

Pete Mueller wrote:
> Hello Charles,
> 
> I should have been more specific.  Yes, I meant without Spring DM.  What I
> am attempting  is to create a system that has X number of services
> registered, but not all services are running at all times, if a service is
> down, the routes that direct messages to it must also be brought down to
> stop messages from being accepted and going nowhere. A simple example would
> be:
> 
> HTTP POST -->  Translator Service --> Database
> 
> If the translator service is brought offline, the HTTP listener and database
> resources should be brought down as well.
>  
> My first thought was to:
> 1. Creating a bundle with just an "empty" camel context. 
> 2. Registering my service using iPOJO in a separate bundle
> 3. Creating a separate bundle that has a route written in Java DSL that uses
> the context from (1) and the service from (2) 
> 
> The idea is to have a central engine that routes can "register" themselves
> to.  Since I'm working with embedded devices, if a particular sub-system
> isn't needed, I'd like to shut it down, which means the routes that would
> send messages to those services would need to be shut down as well.  I guess
> this could also be accomplished by creating an independent camel context for
> every route, but this seems like it would incur extra overhead.
> 
> My OSGi container is essentially a "clean" install of Karaf, so I do have
> the Spring Deployer at my disposal, but not Spring DM.  It is not clear to
> me which features are used by which parts of a camel project  
>  
> Some questions:
> - How do I create the camel content and export it to be picked up by the
> routing bundle. Is this done automatically? 
> - Do I need Spring DM to use the <osgi:service> elements?
> - Do I need Spring DM to use the .beanRef() camel routing?  
> - If I have OSGi services defined with iPOJO, how do I access them from a
> camel route?  
> 
> If there is a better way to accomplish the goal, I'm open to suggestions. 
> -p
> 
> 
> cmoulliard wrote:
>> Hi Peter,
>>
>> Can you precise what you understand by 'without spring' ? without
>> spring configuration file, without Spring DM services, ...
>>
>> Camel routes can be defined using Java DSL language and deployed as a
>> bundle top of Apache Felix Karaf. There is an example here :
>> https://svn.apache.org/repos/asf/camel/trunk/examples/camel-example-guice-jms
>>
>> A camel-blueprint component is under construction :
>> https://svn.apache.org/repos/asf/camel/trunk/components/camel-blueprint
>>
>> remark : Blueprint = OSGI RI of Spring DM service
>>
>> Regards,
>>
>> Charles Moulliard
>> Senior Enterprise Architect
>> Apache Camel Committer
>>
>> *****************************
>> blog : http://cmoulliard.blogspot.com
>> twitter : http://twitter.com/cmoulliard
>> Linkedlin : http://www.linkedin.com/in/charlesmoulliard
>>
>> Apache Camel Group :
>> http://www.linkedin.com/groups?home=&gid=2447439&trk=anet_ug_hm
>>
>> ....
>>
>> -----
>> Charles Moulliard
>> SOA Architect
>>
>> My Blog : http://cmoulliard.blogspot.com/  
>>
> 


Mime
View raw message