That may work. I went and found the openwire connector and checked its status
since slave brokers don't start their connectors. This required a bit of
reflection, but it's very fast and only a temporary solution. The problem
still remains, though, that isSlave() seems to make bad assumptions, and
it's used elsewhere in the code, such as in the code that starts up the
connectors. Essentially it looks like:
if (!isSlave()) {
  // start connectors
}

This would completely break the way it's supposed to work except that for
JDBC master/slave, execution never reaches this point until the broker has
obtained the database lock and therefore is the master. I expect the same is
true for shared filesystem master/slave, or someone would probably have
reported it.

I'm not familiar enough with all of the places isSlave() is used, but at the
very least it's highly misleading about what it does.


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


-- 
View this message in context: 
http://www.nabble.com/BrokerService.isSlave%28%29-for-pure-master-slave-only--tp21339542p21374066.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to