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: Sharing a CamelContext across several bundles
Date Tue, 22 Dec 2009 09:49:31 GMT
Hi,

I don't think you get what you want with your pseudo code.
As each <camel:camelContext/> will create a separate camel context for 
you, if the endpoint can't be shared in different camel context, you 
can't access the endpoint from other camel context.
For example
seda endpoint can only be shared with in same camel context.

If you change the bundleB and bundleC to use camel-jms or some other 
components which can across the different JVM, I think you can get what 
your want .

Willem

TheWinch wrote:
> Hi everyone,
> 
> Do you know if it is possible to share a single CamelContext across several
> bundles ? What I'de like to do is to have several bundles contribute to a
> same CamelContext. Example in pseudo code:
> 
>>>From bundle A: define a context
> <camel:camelContext>
>   <!-- maybe some routes here -->
> </camel:camelContext>
> 
>>>From bundle B: contribute some routes
> <!-- this one should be retrieved from OSGi in some manner -->
> <camel:camelContext>
>   <route>
>   <from uri="seda:a_queue"/>
>   <to uri="seda:another_queue"/>
> </camel:camelContext>
> 
>>>From bundle C:
> <!-- this one should be retrieved from OSGi in some manner -->
> <bean id="mybean" class="..."/>
> <camel:camelContext>
>   <route>
>   <!-- this one is also referenced in bundle B -->
>   <from uri="seda:another_queue"/>
>   <to uri="bean:mybean"/>
> </camel:camelContext>
> 


Mime
View raw message