private GetResponse getMessagesForMissingKeys(ConnectedChannel connectedChannel,
      List<ExchangeMetadataResponse> exchangeMetadataResponseList, List<RemoteReplicaInfo> replicasToReplicatePerNode,
      DataNodeId remoteNode, boolean remoteColoGetRequestForStandby) throws ReplicationException, IOException {
    GetRequest getRequest = createGetRequest(replicasToReplicatePerNode, exchangeMetadataResponseList, remoteNode);
    if (getRequest == null) {
      return null;
    }
    GetResponse getResponse;
    long startTime = time.milliseconds();
    try {
      ChannelOutput channelOutput = connectedChannel.sendAndReceive(getRequest);
      getResponse = GetResponse.readFrom(channelOutput.getInputStream(), clusterMap);
      long getRequestTime = time.milliseconds() - startTime;
      replicationMetrics.updateGetRequestTime(getRequestTime, replicatingFromRemoteColo, replicatingOverSsl,
          datacenterName, remoteColoGetRequestForStandby);
      if (getResponse.getError() != ServerErrorCode.NoError) {
        logger.error("Remote node: {} Thread name: {} Remote replicas: {} GetResponse from replication: {}", remoteNode,
            threadName, replicasToReplicatePerNode, getResponse.getError());
        throw new ReplicationException(
            " Get Request returned error when trying to get missing keys " + getResponse.getError());
      }
    } catch (IOException e) {
      responseHandler.onEvent(replicasToReplicatePerNode.get(0).getReplicaId(), e);
      throw e;
    }
    return getResponse;
  }
Gets the messages for the keys that are missing from the local store by issuing a {@link GetRequest} to the remote
node, if there are any missing keys. If there are no missing keys to be fetched, then no request is issued and a
null response is returned.
@param connectedChannel The connection channel to the remote node
@param exchangeMetadataResponseList The list of metadata response from the remote node
@param replicasToReplicatePerNode The list of remote replicas for the remote node
@param remoteNode The remote node from which replication needs to happen
@param remoteColoGetRequestForStandby boolean which indicates if we are getting missing keys for standby or
                                      non-leader replica pairs during leader-based replication.
@return The response that contains the missing messages; or null if no request was issued because there were no
keys missing.
@throws ReplicationException
@throws IOException
ambry-replication/src/main/java/com/github/ambry/replication/ReplicaThread.java