activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tobias Trelle <>
Subject JDBC Master/Slave Patter: Understanding Locking
Date Thu, 07 Oct 2010 06:49:13 GMT

I'm working on a distributed failover solution with two AMQ instances I_1 on
hardware node N_1 and I_2 on N_2, both using a common JDBC persistence store
on a DB2 database (I know KahaDB rocks, but my customer feels a lot better
with his DB2 running for decades).

First, I start instance I_1. It obtains an exclusive lock on table
ACTIVEMQ_LOCK and becomes the master. This shows up in the log of I_1:

 INFO | Using Persistence Adapter:
 INFO | Database adapter driver override recognized for :
[ibm_db2_jdbc_universal_driver_architecture] - adapter: class
 INFO | Database lock driver override not found for :
[ibm_db2_jdbc_universal_driver_architecture].  Will use default
 INFO | Attempting to acquire the exclusive lock to become the Master broker
 INFO | Becoming the master on dataSource:
 INFO | ActiveMQ 5.4.1 JMS Message Broker (localhost) is starting

Then I start instance I_2. It hangs and waits for the lock (thus becoming a

 INFO | Using Persistence Adapter:
 INFO | Database adapter driver override recognized for :
[ibm_db2_jdbc_universal_driver_architecture] - adapter: class

Is this the desired behaiviour?  If I shut down I_1, I_2 continues and
finally becomes the new master instance.

If I understand correctly,
there is only ONE master at all times, even if there are N slaves waiting
idle for the lock?

Is it possible to combine the above failover solution with load balancing,
i.e. having more than one active master, all of them sharing the same JDBC
persistence store?
View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message