private QueueConnectionImpl createNewPrimary(Set excludedServers){
  QueueConnectionImpl primary=null;
  while (primary == null && pool.getPoolOrCacheCancelInProgress() == null) {
    List servers=findQueueServers(excludedServers,1,false,printPrimaryNotFoundError,LocalizedStrings.QueueManagerImpl_COULD_NOT_FIND_SERVER_TO_CREATE_PRIMARY_CLIENT_QUEUE);
    printPrimaryNotFoundError=false;
    if (servers == null || servers.isEmpty()) {
      break;
    }
    Connection connection=null;
    try {
      connection=factory.createClientToServerConnection((ServerLocation)servers.get(0),true);
    }
 catch (    GemFireSecurityException e) {
      throw e;
    }
catch (    Exception e) {
      if (logger.isDebugEnabled()) {
        logger.debug("SubscriptionManagerImpl - error creating a connection to server {}",servers.get(0));
      }
    }
    if (connection != null) {
      primary=initializeQueueConnection(connection,true,queueConnections.getFailedUpdater());
    }
    excludedServers.addAll(servers);
  }
  if (primary != null && sentClientReady && primary.sendClientReady()) {
    readyForEventsAfterFailover(primary);
  }
  return primary;
}

private QueueConnectionImpl createNewPrimary ( Set excludedServers ) { QueueConnectionImpl primary = null ; while ( primary == null && pool . getPoolOrCacheCancelInProgress ( ) == null ) { List servers = findQueueServers ( excludedServers , 1 , false , printPrimaryNotFoundError , LocalizedStrings . QueueManagerImpl_COULD_NOT_FIND_SERVER_TO_CREATE_PRIMARY_CLIENT_QUEUE ) ; printPrimaryNotFoundError = false ; if ( servers == null || servers . isEmpty ( ) ) { break ; } Connection connection = null ; try { connection = factory . createClientToServerConnection ( ( ServerLocation ) servers . get ( 0 ) , true ) ; } catch ( GemFireSecurityException e ) { throw e ; } catch ( Exception e ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "SubscriptionManagerImpl - error creating a connection to server {}" , servers . get ( 0 ) ) ; } } if ( connection != null ) { primary = initializeQueueConnection ( connection , true , queueConnections . getFailedUpdater ( ) ) ; } excludedServers . addAll ( servers ) ; } if ( primary != null && sentClientReady && primary . sendClientReady ( ) ) { readyForEventsAfterFailover ( primary ) ; } return primary ; }
create a new primary server from a non - redundant server . add any failed servers to the excludedservers set .
