This closes #858

This commit is contained in:
Clebert Suconic 2016-10-22 10:41:21 -04:00
commit e5df63c241
2 changed files with 20 additions and 0 deletions

View File

@ -1024,6 +1024,16 @@ public interface ActiveMQServerLogger extends BasicLogger {
@Message(id = 222164, value = "Error when trying to start replication {0}", format = Message.Format.MESSAGE_FORMAT)
void errorStartingReplication(BackupReplicationStartFailedMessage.BackupRegistrationProblem problem);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222165, value = "No Dead Letter Address configured for queue {0} in AddressSettings",
format = Message.Format.MESSAGE_FORMAT)
void AddressSettingsNoDLA(SimpleString name);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222166, value = "No Expiry Address configured for queue {0} in AddressSettings",
format = Message.Format.MESSAGE_FORMAT)
void AddressSettingsNoExpiryAddress(SimpleString name);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222167, value = "Group Binding not available so deleting {0} groups from {1}, groups will be bound to another node",
format = Message.Format.MESSAGE_FORMAT)

View File

@ -2989,10 +2989,20 @@ public class QueueImpl implements Queue {
public void onChange() {
AddressSettings settings = addressSettingsRepository.getMatch(address.toString());
configureExpiry(settings);
checkDeadLetterAddressAndExpiryAddress(settings);
configureSlowConsumerReaper(settings);
}
}
private void checkDeadLetterAddressAndExpiryAddress(final AddressSettings settings) {
if (settings.getDeadLetterAddress() == null) {
ActiveMQServerLogger.LOGGER.AddressSettingsNoDLA(name);
}
if (settings.getExpiryAddress() == null) {
ActiveMQServerLogger.LOGGER.AddressSettingsNoExpiryAddress(name);
}
}
private final class SlowConsumerReaperRunnable implements Runnable {
private final SlowConsumerPolicy policy;