Hi Just refer to the name of the component.
template.sendBody("internalActivemq:queue:foo", "Hello Internal"); template.sendBody("externalActivemq:queue:bar", "Hello External"); On Tue, Sep 27, 2011 at 9:53 PM, KaiLa <bho...@gmail.com> wrote: > Hi, > > I have a requirement where I need to connect to two brokers. I am consuming > messages from one broker and will process those messages and publish new > messages to another broker. > > I went through a number of Camel and ActiveMQ documentations but didn't see > an example on how I can inject a specific ActiveMQComponent to a > ProducerTemplate. > > So, if I have two ActiveMQComponent beans defined in my spring, how can I > configure the camelContext to inject specific ActiveMQComponent for the > ProducerTemplate without specifying a specific endpoint since our service > level code generates the queue and topic names. I need a way to essentially > tell it to use a given ActiveMQComponent for producerTemplate explicitly. > Thanks. > > <bean id="internalActivemq" > class="org.apache.activemq.camel.component.ActiveMQComponent"> > <property name="connectionFactory"> > <bean class="org.apache.activemq.ActiveMQConnectionFactory"> > <property name="brokerURL" > value="vm://internalUrl?broker.persistent=false&broker.useJmx=false"/> > </bean> > </property> > </bean> > > <bean id="externalActivemq" > class="org.apache.activemq.camel.component.ActiveMQComponent"> > <property name="connectionFactory"> > <bean class="org.apache.activemq.ActiveMQConnectionFactory"> > <property name="brokerURL" > value="vm://externalUrl?broker.persistent=false&broker.useJmx=false"/> > </bean> > </property> > </bean> > > -- > View this message in context: > http://camel.465427.n5.nabble.com/How-specify-which-ActiveMQComponent-to-use-for-ProducerTemplate-when-connecting-to-two-brokers-tp4846789p4846789.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- Claus Ibsen ----------------- FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/