Add WARN log when setting connection-ttl OR connection-ttl-override equal to check-period.
This commit is contained in:
parent
a94cfd5416
commit
6b13b3bf97
|
@ -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");
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue