activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From NabiL <>
Subject JDBC Master/Slave
Date Mon, 19 Oct 2009 21:34:29 GMT


I try to set up two AMQ 5.3 brokers (deployed on 2 tomcat servers ) to get
some redundancy in
our solution. 

The AMQ documentation describes the JDBC Master/slave as below :
On startup one master grabs an exclusive lock in the broker database and all
other brokers are slaves and pause waiting for the exclusive lock. 
>> This situation occurs only if we use AMQ as standalone (not embedding in
>> server container tomcat)

I configured the 2 AMQ Web-console5.3.war on each Tomcat server to use a
shared DB (Mysql). As a result, the master start successfully and grabs the
lock, the AMQ slave can't start. To resolve this situation i positioned

Questions : 
1 - If i disable database locking.. Do i need to use some other mechanism
to stop the slave broker from becoming active while the master is on-line in
order to avoid data corruption ?

2 - i configured  persistenceAdapter element on each broker as show below :
        <jdbcPersistenceAdapter dataSource="#mysql-ds"

<bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource"
		<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
		<property name="url"
		<property name="username" value="xxx"/>
		<property name="password" value="xxx"/>
		<property name="maxActive" value="200"/>
		<property name="poolPreparedStatements" value="true"/>
 As you can see, i did not specify  any data
directory="${activemq.base}/data/ on jdbcPersistenceAdapter element. What is
the difference if specify the data directory on this element ?

Sorry for my bad english. Any help will be appreciated.

Thanks in advance.

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message