You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Bond <ch...@gmail.com> on 2010/07/24 07:37:41 UTC

Multiple Sources

I have a following requirement. 
<route> 
                        <from uri="jms:topic:topic1"/> 
                       <to  uri="bean:msgParser"/> 
                       <to  uri="bean:msgProcessor"/> 
</route> 

<route> 
                        <from uri="jms:topic:topic2"/> 
                       <to  uri="bean:msgParser"/> 
                       <to uri="bean:msgProcessor"/> 
</route> 
<route> 
                        <from uri="jms:topic:topic3"/> 
                       <to uri="bean:msgParser"/> 
                       <to uri="bean:msgProcessor"/> 
</route> 
. 
. 
. 
. 
. 
<route> 
                        <from uri="jms:topic:topicN"/> 
                       <to  uri="bean:msgParser"/> 
                       <to  uri="bean:msgProcessor"/> 
</route> 
N= No. of configured topics. All the above route are independent of each
other and parsing and processing would be daone in different threads. 
I know above thing can be achieved in Java DSL using a for loop. I would
like to know if the same can be achived using spring xml. 

Thanks in advance. 
-- 
View this message in context: http://camel.465427.n5.nabble.com/Multiple-Sources-tp1924844p1924844.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.

Re: Multiple Sources

Posted by Claus Ibsen <cl...@gmail.com>.
If you are using ActiveMQ it supports wild cards in the destination
name, so you can consume from multiple topics from the same consumer.
http://activemq.apache.org/virtual-destinations.html




On Sat, Jul 24, 2010 at 7:37 AM, Bond <ch...@gmail.com> wrote:
>
> I have a following requirement.
> <route>
>                        <from uri="jms:topic:topic1"/>
>                       <to  uri="bean:msgParser"/>
>                       <to  uri="bean:msgProcessor"/>
> </route>
>
> <route>
>                        <from uri="jms:topic:topic2"/>
>                       <to  uri="bean:msgParser"/>
>                       <to uri="bean:msgProcessor"/>
> </route>
> <route>
>                        <from uri="jms:topic:topic3"/>
>                       <to uri="bean:msgParser"/>
>                       <to uri="bean:msgProcessor"/>
> </route>
> .
> .
> .
> .
> .
> <route>
>                        <from uri="jms:topic:topicN"/>
>                       <to  uri="bean:msgParser"/>
>                       <to  uri="bean:msgProcessor"/>
> </route>
> N= No. of configured topics. All the above route are independent of each
> other and parsing and processing would be daone in different threads.
> I know above thing can be achieved in Java DSL using a for loop. I would
> like to know if the same can be achived using spring xml.
>
> Thanks in advance.
> --
> View this message in context: http://camel.465427.n5.nabble.com/Multiple-Sources-tp1924844p1924844.html
> Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Multiple Sources

Posted by Willem Jiang <wi...@gmail.com>.
Hi

Current Spring configure doesn't support to create the route dynamically 
as the Java DSL.

If you have to use the Spring configure to start the camel context, you 
could consider to specify the RouteBuilder[1] yourself in the Spring 
configure.

[1]http://camel.apache.org/spring.html

Willem

Bond wrote:
> I have a following requirement. 
> <route> 
>                         <from uri="jms:topic:topic1"/> 
>                        <to  uri="bean:msgParser"/> 
>                        <to  uri="bean:msgProcessor"/> 
> </route> 
> 
> <route> 
>                         <from uri="jms:topic:topic2"/> 
>                        <to  uri="bean:msgParser"/> 
>                        <to uri="bean:msgProcessor"/> 
> </route> 
> <route> 
>                         <from uri="jms:topic:topic3"/> 
>                        <to uri="bean:msgParser"/> 
>                        <to uri="bean:msgProcessor"/> 
> </route> 
> . 
> . 
> . 
> . 
> . 
> <route> 
>                         <from uri="jms:topic:topicN"/> 
>                        <to  uri="bean:msgParser"/> 
>                        <to  uri="bean:msgProcessor"/> 
> </route> 
> N= No. of configured topics. All the above route are independent of each
> other and parsing and processing would be daone in different threads. 
> I know above thing can be achieved in Java DSL using a for loop. I would
> like to know if the same can be achived using spring xml. 
> 
> Thanks in advance.