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: One processor for multiple camelContext
Date Wed, 03 Apr 2013 02:46:03 GMT
Hi,

Please check out my comment in the below mail.  

--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | 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 Tuesday, April 2, 2013 at 9:24 PM, valerian.merkling wrote:

> Hi !
>  
> In my project there is a lot of communication by mail with attached zipped
> xml files.
>  
> So i made two processor to zip the file, or unzip from a mail.  
>  
> My problem is that i have three differents bundles (three jar, three
> camelContext), all of them using those two processors.
>  
> How can i make these processors available for everyone ?
>  
> I read a few doc about camel registry, but i don't get it.
If you want to reference some object from the URI, you may need to get touch with concept
of  camel registry.
If you want to access the Processor from your camel context, you need let Camel look up it
from the registry. In most case you don't need to create the registry by yourself if you are
using Spring or Blueprint. Camel will delegate the registry look up work to the Spring or
Blueprint.

>  
> When i write  
>  
> /<bean id="beantest" name="beantest" class="test.TestRegisterProcessor"/>/
>  
> Does it call the registry ?
It's common practice to register the bean into Spring application context. And Camel can help
you to look up the Object by using the name "beantest".  
>  
>  
> This (obviously) works :
>  
> File1 :
> /<bean id="beantest" name="beantest" class="test.TestRegisterProcessor"/>
> <camelContext id="first-context" />
> <route id="route1>
> <from .../>
> <to uri="beantest" />
> </route>
> </camelContext>
> /

The camel context can lookup the bean test from the Spring Application Context.  
> But how i can make this works :
>  
> File2 :
> /<camelContext id="second-context" />
> <route id="route2>
> <from .../>
> <to uri="beantest" />
> </route>
> </camelContext>/
>  
You need to make sure Camel can find out the bean test from the Spring application context.
 
>  
>  
> Thanks for your help !
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/One-processor-for-multiple-camelContext-tp5730213.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).




Mime
View raw message