protected void dispatchMessage(Message<ID> msg) throws MemberShunnedException {
    ID m = msg.getSender();
    boolean shunned = false;

    // If this member is shunned or new, grab the latestViewWriteLock: update the appropriate data
    // structure.
    if (isShunnedOrNew(m)) {
      if (isShunned(m)) {
        if (!(msg instanceof StopShunningMarker)) {
          // fix for bug 41538 - sick alert listener causes deadlock
          // due to view latestViewReadWriteLock being held during messaging
          shunned = true;
        }
      }

      if (!shunned) {
        // If it's a new sender, wait our turn, generate the event
        if (isNew(m)) {
          shunned = !addSurpriseMember(m);
        }
      }
    }

    if (shunned) { // bug #41538 - shun notification must be outside synchronization to avoid
      // hanging
      logger.warn("Membership: disregarding shunned member <{}>", m);
      if (logger.isTraceEnabled()) {
        logger.trace("Membership: Ignoring message from shunned member <{}>:{}", m, msg);
      }
      throw new MemberShunnedException();
    }

    messageListener.messageReceived(msg);
  }
Logic for processing a distribution message.
<p>
It is possible to receive messages not consistent with our view. We handle this here, and
generate an uplevel event if necessary

@param msg the message
geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSMembership.java