@Override
    public void run() {
      Map<DistributionLocatorId, Set<LocatorJoinMessage>> failedMessages = new HashMap<>();
      for (Map.Entry<Integer, Set<DistributionLocatorId>> entry : remoteLocators.entrySet()) {
        for (DistributionLocatorId remoteLocator : entry.getValue()) {
          // Notify known remote locator about the advertised locator.
          LocatorJoinMessage advertiseNewLocatorMessage = new LocatorJoinMessage(
              joiningLocatorDistributedSystemId, joiningLocator, localLocatorId, "");
          sendMessage(remoteLocator, advertiseNewLocatorMessage, failedMessages);

          // Notify the advertised locator about remote known locator.
          LocatorJoinMessage advertiseKnownLocatorMessage =
              new LocatorJoinMessage(entry.getKey(), remoteLocator, localLocatorId, "");
          sendMessage(joiningLocator, advertiseKnownLocatorMessage, failedMessages);
        }
      }

      // Retry failed messages and remove those that succeed.
      if (!failedMessages.isEmpty()) {
        for (int attempt = 1; attempt <= LOCATOR_DISTRIBUTION_RETRY_ATTEMPTS; attempt++) {

          for (Map.Entry<DistributionLocatorId, Set<LocatorJoinMessage>> entry : failedMessages
              .entrySet()) {
            DistributionLocatorId targetLocator = entry.getKey();
            Set<LocatorJoinMessage> joinMessages = entry.getValue();

            for (Iterator<LocatorJoinMessage> iterator = joinMessages.iterator(); iterator
                .hasNext();) {
              LocatorJoinMessage locatorJoinMessage = iterator.next();
              if (retryMessage(targetLocator, locatorJoinMessage, attempt)) {
                iterator.remove();
              } else {
                // Sleep between retries.
                try {
                  Thread.sleep(memberTimeout);
                } catch (InterruptedException e) {
                  Thread.currentThread().interrupt();
                  logger.warn(
                      "Locator Membership listener permanently failed to exchange locator information due to interruption.");
                  return;
                }
              }
            }
          }
        }
      }
    }
A locator from the request is checked against the existing remote locator metadata. If it is
not available then added to existing remote locator metadata and LocatorMembershipListener is
invoked to inform about the newly added locator to all other locators available in remote
locator metadata. As a response, remote locator metadata is sent.
geode-wan/src/main/java/org/apache/geode/cache/wan/internal/client/locator/LocatorMembershipListenerImpl.java