You can add the components dynamically into the camel context with below
code, but I don't think you can do it in spring :(
CamelContext.
ConnectionFactory connectionFactory1 = new
ActiveMQConnectionFactory("someBrokerUrl");
// Note we can explicity name the component
context.addComponent("jms1",
JmsComponent.jmsComponentAutoAcknowledge(connectionFactory1));
...
On 6/7/11 8:07 PM, Hossein wrote:
Willem,
Thanks for your email reply.
How would I set up my connections in Java DSL? Usually, I setup the
connection in Spring like [1]. However, that would work for connecting to 1
broker. Our requirement is to connect to +100 brokers. Yes that is correct
+100 brokers. The plan is to have multiple SMX connecting to these brokers.
Let's say we have 2 SMX, same bundle in each SMX. SMX1, Bundle1 would
connect to brokers 1-50 and the other to 51-100 [2].
So, question is how would I setup my Java DSL to dynamically create
connection and create route?
[1]
<bean name="activemq"
class="org.apache.activemq.camel.component.ActiveMQComponent">
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="someBrokerUrl/>
</bean>
</property>
</bean>
[2]
<entry>
key="bundle1_t1">brokerUrl=url1,userId=userid1,pwd=pwd1,topicName=tname1</entry>
...
<entry>
key="bundle1_tn">brokerUrl=url2,userId=userid2,pwd=pwd2,topicName=tname2</entry>
--
View this message in context:
http://camel.465427.n5.nabble.com/Java-DSL-Dynamic-Broker-Config-tp4460059p4461549.html
Sent from the Camel - Users mailing list archive at Nabble.com.
--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang