ARTEMIS-151 avoiding duplicate config of acceptors

This commit is contained in:
Clebert Suconic 2015-10-07 22:07:05 -04:00
parent c3448e7029
commit 4eb669f035
2 changed files with 12 additions and 0 deletions

View File

@ -206,7 +206,15 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
threadPool = Executors.newCachedThreadPool(tFactory); threadPool = Executors.newCachedThreadPool(tFactory);
HashSet<TransportConfiguration> namelessAcceptors = new HashSet<>();
for (TransportConfiguration info : acceptorsConfig) { for (TransportConfiguration info : acceptorsConfig) {
TransportConfiguration nameless = info.newTransportConfig("");
if (namelessAcceptors.contains(nameless)) {
ActiveMQServerLogger.LOGGER.duplicatedAcceptor(info.getName(), "" + info.getParams(), info.getFactoryClassName());
continue;
}
namelessAcceptors.add(nameless);
try { try {
AcceptorFactory factory = server.getServiceRegistry().getAcceptorFactory(info.getName(), info.getFactoryClassName()); AcceptorFactory factory = server.getServiceRegistry().getAcceptorFactory(info.getName(), info.getFactoryClassName());

View File

@ -1441,4 +1441,8 @@ public interface ActiveMQServerLogger extends BasicLogger {
@Message(id = 224065, value = "Failed to remove auto-created queue {0}", format = Message.Format.MESSAGE_FORMAT) @Message(id = 224065, value = "Failed to remove auto-created queue {0}", format = Message.Format.MESSAGE_FORMAT)
void errorRemovingAutoCreatedQueue(@Cause Exception e, SimpleString bindingName); void errorRemovingAutoCreatedQueue(@Cause Exception e, SimpleString bindingName);
@LogMessage(level = Logger.Level.WARN)
@Message(id = 224066, value = "Duplicated Acceptor {0} with parameters {1} classFactory={2} duplicated on the configuration", format = Message.Format.MESSAGE_FORMAT)
void duplicatedAcceptor(String name, String parameters, String classFactory);
} }