int getRequestId(Message<ID> gfmsg, ID destination, boolean add) {
    int requestId = 0;
    if (gfmsg instanceof FindCoordinatorRequest) {
      requestId = ((FindCoordinatorRequest<ID>) gfmsg).getRequestId();
    } else if (gfmsg instanceof JoinRequestMessage) {
      requestId = ((JoinRequestMessage<ID>) gfmsg).getRequestId();
    } else if (gfmsg instanceof FindCoordinatorResponse) {
      requestId = ((FindCoordinatorResponse<ID>) gfmsg).getRequestId();
    } else if (gfmsg instanceof JoinResponseMessage) {
      requestId = ((JoinResponseMessage<ID>) gfmsg).getRequestId();
    }

    if (add) {
      addRequestId(requestId, destination);
    }

    return requestId;
  }
This is the constructor to use to create a JGroups message holding a GemFire
DistributionMessage. It sets the appropriate flags in the Message and properly serializes the
DistributionMessage for the recipient's product version

@param gfmsg the DistributionMessage
@param src the sender address
@param versionOrdinal the version of the recipient
@return the new message
geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/JGroupsMessenger.java