activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Allan Araya <>
Subject Connect to multiple brokers, one at a time
Date Mon, 07 Apr 2014 14:40:25 GMT

I'm developing a java application which is intended to connect to 
several activeMQ brokers, but just one at a time.
The idea is to show a list of the possible brokers available and let the 
user choose one to connect.
The list of brokers will be predefined, so no discovery is needed. Also 
i'm working with spring beans, my beans definition looks like this:

<bean id="jmsContainer"
         <property name="connectionFactory" ref="connectionFactory" />
         <property name="destination" ref="destination" />
         <property name="messageListener" ref="messageListener" />
         <property name="autoStartup" value="true" />

     <bean id="connectionFactory" 
         <property name="connectionFactory">
             <bean class="org.apache.activemq.ActiveMQConnectionFactory">
                 <property name="brokerURL"
                     value="failover:tcp://" />
                 <property name="transportListener" 
ref="transportListener" />

     <bean id="destination" 
         <constructor-arg index="0" value="var3Topic" />

I've been trying several configurations, all I have achieved is to 
connect to just one of the brokers (always the same one no matter what 
broker I choose),
  or to connect to all of them at the same time.

Any help will be appreciated,

Thanks, Allan.

View raw message