activemq-users mailing list archives

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

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"
class="org.springframework.jms.listener.DefaultMessageListenerContainer">
         <property name="connectionFactory" ref="connectionFactory" />
         <property name="destination" ref="destination" />
         <property name="messageListener" ref="messageListener" />
         <property name="autoStartup" value="true" />
     </bean>

     <bean id="connectionFactory" 
class="org.apache.activemq.pool.PooledConnectionFactory"
         destroy-method="stop">
         <property name="connectionFactory">
             <bean class="org.apache.activemq.ActiveMQConnectionFactory">
                 <property name="brokerURL"
                     value="failover:tcp://192.168.1.15:61616" />
                 <property name="transportListener" 
ref="transportListener" />
             </bean>
         </property>
     </bean>

     <bean id="destination" 
class="org.apache.activemq.command.ActiveMQTopic">
         <constructor-arg index="0" value="var3Topic" />
     </bean>


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.

Mime
View raw message