public void closeProcessor() {
    if (logger.isDebugEnabled()) {
      logger.debug("Closing dispatcher");
    }
    try {
      if (sender.isPrimary() && queue.size() > 0) {
        logger.warn("Destroying GatewayEventDispatcher with actively queued data.");
      }
      if (resetLastPeekedEvents) {
        notifyPossibleDuplicate(STOPPED_GATEWAY_SENDER, pendingEventsInBatches());
        resetLastPeekedEvents();
        resetLastPeekedEvents = false;
      }
    } catch (RegionDestroyedException | CancelException | CacheException ignore) {
    } finally {
      queue.close();
      if (logger.isDebugEnabled()) {
        logger.debug("Closed dispatcher");
      }
    }
  }
Stops the dispatcher from dispatching events . The dispatcher will stay alive for a predefined
time OR until its queue is empty.

@see AbstractGatewaySender#MAXIMUM_SHUTDOWN_WAIT_TIME
geode-core/src/main/java/org/apache/geode/internal/cache/wan/AbstractGatewaySenderEventProcessor.java