activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From songu <songu...@gmail.com>
Subject consumer finished right after master broker is killed
Date Mon, 10 Sep 2012 03:03:47 GMT
Hi Guys,

I am new to ActiveMQ. Currently I am using 5.6.0 and trying pure
master/slave setup. I start up two brokers in the same server but different
ports. During my testing, I am using the config in consumer as:

failover://(tcp://server:61616,tcp://server:61618)?randomize=false

Then right after I killed the master broker, I noticed the slave became the
master, which is expected. But all the consumers that used to connect with
original master borker were finished. 

Could some one suggest what could be wrong? My consumer codes are the
following:

        String
url="failover://(tcp://server:61616,tcp://server:61618)?randomize=false";
        ConnectionFactory connectionFactory = new
ActiveMQConnectionFactory(url); 
        Connection connection = connectionFactory.createConnection(); 
        connection.start(); 
 
        Session session = connection.createSession(false,
Session.AUTO_ACKNOWLEDGE); 
        Queue msgQueue = session.createQueue(topic);
        MessageConsumer consumer = session.createConsumer(msgQueue); 
        consumer.setMessageListener(listener);

Thanks in advance!



--
View this message in context: http://activemq.2283324.n4.nabble.com/consumer-finished-right-after-master-broker-is-killed-tp4656235.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message