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: Confused with Camel in Spring/OSGI
Date Thu, 13 Feb 2014 01:43:45 GMT
Hi,

Current camel-spring are only tested with Spring-DM, camel-blueprint could be an option for
you if the Virgo server support the Blueprint out of box, but you may not use the some advance
features that spring provides.


--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com(http://willemjiang.blogspot.com/) (English)
http://jnn.iteye.com(http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On February 13, 2014 at 1:35:55 AM, Mangin, Franck (franckmangin@fico.com) wrote:
>  
> Well, as far as I can tell (and I may definitely be missing something)  
> the state of OSGI support in camel-spring is in a pretty sorry  
> state of affair...
>  
>  
>  
> camel-spring 2.12.2 depends on spring 3.1.0.RELEASE, but it  
> contains references to the BundleContextAware class which  
> doesn't seem to be supported anymore in spring 3.x. Trying to  
> grab that class from old org.springframework.osgi bundles  
> doesn't help presumably because nobody in spring 3 is paying  
> attention to that interface anymore so the injection of the bundle  
> context doesn't happen.
>  
>  
>  
> I tried to work around that by declaring my own CamelNamespaceHandler,  
> which registers my own CamelContextFactoryBean which obtains  
> the bundle context by other means.
>  
> That however eventually fails because the org.apache.camel.core.osgi  
> package is not exported by camel-spring.
>  
>  
>  
> Looks like the smartest thing to do will be to give up on spring  
> configuration alltogether and create my own Camel context manually.  
>  
>  
>  
> There is a lot valuable code in org.apache.camel.core.osgi  
> and in org.apache.camel.osgi, it is too bad that it is apparently  
> only tested and working on karaf.
>  
> If someone know what the proper equivalent to BundleContextAware  
> is in spring 3 is I could provide a modified bean factory if that  
> is of interest.
>  
>  
>  
> Franck
>  
>  
>  
> -----Original Message-----
> From: Claus Ibsen [mailto:claus.ibsen@gmail.com]
> Sent: Wednesday, February 12, 2014 3:29 PM
> To: users@camel.apache.org
> Subject: Re: Confused with Camel in Spring/OSGI
>  
>  
>  
> Hi
>  
>  
>  
> Camel works the best in Apache Karaf as its OSGi container.
>  
> That is what we use for development and testing.
>  
>  
>  
> There may be some caveats and issues running in Eclipse Virgo.  
>  
>  
>  
> If it does not matter for you which osgi container, then I suggest  
> to use Apache Karaf
>  
>  
>  
>  
>  
> On Wed, Feb 12, 2014 at 1:47 PM, franck102 >  
> wrote:
>  
> > I am trying to use Camel 2.12. in a Virgo server, using spring/OSGI  
>  
> > since Virgo's blueprint is based on Gemini.
>  
> >
>  
> > The context.xml file below sucessfully starts a camel context...  
>  
> > however breaking in the code shows that I am instantiating a  
>  
> > SpringCamelContext rather than a org.apache.camel.core.osgi.OsgiDefaultCamelContext.
 
>  
> >
>  
> > It looks like I want the org.apache.camel.osgi.CamelContextFactoryBean  
>  
> > to create my camel context, but I just can't figure out how to  
> tell
>  
> > Spring to use that factory. I have read hundreds of posts about  
> camel,
>  
> > spring & OSGI and I just can't figure this out, any help would  
> be greatly appreciated!
>  
> >
>  
> > I am using maven and having dependencies on camel-core and camel-spring.  
>  
> > It looks like osgi support has been embedded into camel-spring,  
> and so
>  
> > I should not need or want dependencies on camel-core-osgi or  
> camel-osgi?
>  
> >
>  
> >
>  
> >  
>  
> >
>  
> > >  
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
>  
> > xsi:schemaLocation="
>  
> > http://www.springframework.org/schema/beans
>  
> > http://www.springframework.org/schema/beans/spring-beans-3.0.xsd  
>  
> > http://camel.apache.org/schema/spring
>  
> > http://camel.apache.org/schema/spring/camel-spring.xsd">  
>  
> >
>  
> > >  
> > xmlns="http://camel.apache.org/schema/spring">
>  
> > >  
> > uri="seda:mcedits?multipleConsumers=true"/>
>  
> >
>  
> >  
>  
> >  
>  
> >  
>  
> >  
>  
> >  
>  
> >  
>  
> >  
>  
> >  
>  
> >  
>  
> >
>  
> >  
>  
> >  
>  
> >
>  
> >
>  
> >
>  
> >
>  
> > --
>  
> > View this message in context:
>  
> > http://camel.465427.n5.nabble.com/Confused-with-Camel-in-Spring-OSGI-t  
>  
> > p5747186.html Sent from the Camel - Users mailing list archive  
> at
>  
> > Nabble.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 Make  
> your Camel applications look hawt, try: http://hawt.io
>  
> This email and any files transmitted with it are confidential,  
> proprietary and intended solely for the individual or entity  
> to whom they are addressed. If you have received this email in  
> error please delete it immediately.
>  


Mime
View raw message