activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a_schulle <>
Subject Broker stops after loosing database connection
Date Tue, 07 Aug 2012 14:12:05 GMT
We are using Version 5.6.0 in an "JDBC Master Slave" configuration.
In the case that the master looses the connection to the database it stops
the broker. This is the part of JDBCPersistenceAdapter where it happens:

    protected void databaseLockKeepAlive() {
        boolean stop = false;
        try {
            DatabaseLocker locker = getDatabaseLocker();
            if (locker != null) {
                if (!locker.keepAlive()) {
                    stop = true;
        } catch (IOException e) {
            LOG.error("Failed to get database when trying keepalive: " + e,
        if (stop) {

    protected void stopBroker() {
        // we can no longer keep the lock so lets fail"No longer able to keep the exclusive lock so giving up
being a master");
        try {
        } catch (Exception e) {
            LOG.warn("Failure occurred while stopping broker");

This behavior was a little unespected to us. The consequence is that this
instance have to be restartet when the network connection comes up again.

It would be nice if such a broker would try to reestablish the connection to
the database and after reconnect becomming a slave. Is there a way to
configure ActiveMQ like this?

I would appreciate any help. Thanks!

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

View raw message