activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eivind Sivertsen <eivind.sivert...@gmail.com>
Subject Re: Master/slave configuration
Date Fri, 24 Jun 2011 07:34:51 GMT
When you create a connection using the ActiveMQConnectionFactory, cast 
it to an ActiveMQConnection:

ActiveMQConnectionFactory factory = new 
ActiveMQConnectionFactory(brokerUrl);
ActiveMQConnection conn = (ActiveMQConnection) factory.createConnection();

And let your TransportListener implementation have a reference to conn.

In your TransportListener implementation, on transportResumed(), use

conn.getBrokerName()
conn.getBrokerInfo().getBrokerURL()
conn.getBrokerInfo().isSlaveBroker()

(haven't tried this myself, but it hopefylly works)

Mime
View raw message