If you cast the value of brokerService.getPersistenceAdapter to the
JDBCPersistenceAdapter you should be able to access the database
locker[1]

I suspect that the keepAlive() method will return false while still a
slave. It is worth a try.

This is the area you need to look at though.

Gary.

[1] 
http://svn.apache.org/viewvc/activemq/tags/activemq-5.1.0/activemq-core/src/main/java/org/apache/activemq/store/jdbc/DatabaseLocker.java?view=markup

2009/1/7 Ryan Stewart <rds6...@gmail.com>:
>
> I'm trying to find a way to tell whether a broker is master or not on version
> 5.1. I know that 5.2 has the advisory topic for when a broker becomes
> master, but I can't use that just now. I do have access to the
> BrokerService, though, which has the isSlave() method; however I'm using
> JDBC master/slave, and this method only checks the state of the
> BrokerService's MasterConnector.
>
> How do I tell whether a broker is a master or not when using JDBC
> master/slave?
> --
> View this message in context: 
> http://www.nabble.com/BrokerService.isSlave%28%29-for-pure-master-slave-only--tp21339542p21339542.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>



-- 
http://blog.garytully.com

Open Source SOA
http://FUSESource.com

Reply via email to