This closes #56 Warning on TTL

This commit is contained in:
Clebert Suconic 2015-06-29 09:52:50 -04:00
commit 8386ba0fa3
2 changed files with 24 additions and 1 deletions

View File

@ -1525,6 +1525,9 @@ public final class FileConfigurationParser extends XMLConfigurationUtil
}
}
// Warn if connection-ttl-override/connection-ttl == check-period
compareTTLWithCheckPeriod(mainConfig, connectionTTL, clientFailureCheckPeriod);
ClusterConnectionConfiguration config = new ClusterConnectionConfiguration()
.setName(name)
.setAddress(address)
@ -1686,6 +1689,9 @@ public final class FileConfigurationParser extends XMLConfigurationUtil
}
}
// Warn if connection-ttl-override/connection-ttl == check-period
compareTTLWithCheckPeriod(mainConfig, connectionTTL, clientFailureCheckPeriod);
BridgeConfiguration config = new BridgeConfiguration()
.setName(name)
.setQueueName(queueName)
@ -1805,4 +1811,13 @@ public final class FileConfigurationParser extends XMLConfigurationUtil
.setParams(params)
.setName(name);
}
private void compareTTLWithCheckPeriod(final Configuration config, final long connectionTTL, final long checkPeriod)
{
if (config.getConnectionTTLOverride() == checkPeriod)
ActiveMQServerLogger.LOGGER.connectionTTLEqualsCheckPeriod("connection-ttl-override", "check-period");
if (connectionTTL == checkPeriod)
ActiveMQServerLogger.LOGGER.connectionTTLEqualsCheckPeriod("connection-ttl", "check-period");
}
}

View File

@ -1166,6 +1166,14 @@ public interface ActiveMQServerLogger extends BasicLogger
format = Message.Format.MESSAGE_FORMAT)
void backupActivationTimeout();
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222202,
value = "<{0}> should not be set to the same value as <{1}>. " +
"If a system is under high load, or there is a minor network delay, " +
"there is a high probability of a cluster split/failure due to connection timeout.",
format = Message.Format.MESSAGE_FORMAT)
void connectionTTLEqualsCheckPeriod(String ttl, String checkPeriod);
@LogMessage(level = Logger.Level.ERROR)
@Message(id = 224000, value = "Failure in initialisation", format = Message.Format.MESSAGE_FORMAT)
void initializationError(@Cause Throwable e);