{
HornetQServerLogger.LOGGER.clusterConnectionAlreadyExists(config.getConnectorName());
return;
}
ClusterConnectionImpl clusterConnection;
DiscoveryGroupConfiguration dg;
if (config.getDiscoveryGroupName() != null)
{
dg = configuration.getDiscoveryGroupConfigurations()
.get(config.getDiscoveryGroupName());
if (dg == null)
{
HornetQServerLogger.LOGGER.clusterConnectionNoDiscoveryGroup(config.getDiscoveryGroupName());
return;
}
if (HornetQServerLogger.LOGGER.isDebugEnabled())
{
HornetQServerLogger.LOGGER.debug(this + " Starting a Discovery Group Cluster Connection, name=" +
config.getDiscoveryGroupName() +
", dg=" +
dg);
}
clusterConnection = new ClusterConnectionImpl(this,
dg,
connector,
new SimpleString(config.getName()),
new SimpleString(config.getAddress()),
config.getMinLargeMessageSize(),
config.getClientFailureCheckPeriod(),
config.getConnectionTTL(),
config.getRetryInterval(),
config.getRetryIntervalMultiplier(),
config.getMaxRetryInterval(),
config.getReconnectAttempts(),
config.getCallTimeout(),
config.getCallFailoverTimeout(),
config.isDuplicateDetection(),
config.isForwardWhenNoConsumers(),
config.getConfirmationWindowSize(),
executorFactory,
threadPool,
server,
postOffice,
managementService,
scheduledExecutor,
config.getMaxHops(),
nodeManager,
backup,
server.getConfiguration().getClusterUser(),
server.getConfiguration().getClusterPassword(),
config.isAllowDirectConnectionsOnly(),
config.getClusterNotificationInterval(),
config.getClusterNotificationAttempts());
}
else
{
TransportConfiguration[] tcConfigs = config.getStaticConnectors() != null ? connectorNameListToArray(config.getStaticConnectors())
: null;
if (HornetQServerLogger.LOGGER.isDebugEnabled())
{
HornetQServerLogger.LOGGER.debug(this + " defining cluster connection towards " + Arrays.toString(tcConfigs));
}
clusterConnection = new ClusterConnectionImpl(this,
tcConfigs,
connector,
new SimpleString(config.getName()),
new SimpleString(config.getAddress()),
config.getMinLargeMessageSize(),