@Override
    public void afterCreate(EntryEvent event) {
      Cache cache = event.getRegion().getCache();
      Iterator iter = cache.getCacheServers().iterator();
      CacheServerImpl server = (CacheServerImpl) iter.next();
      isObjectPresent = false;

      // The event not be there in the region first time; try couple of time.
      // This should have been replaced by listener on the HARegion and doing wait for event arrival
      // in that.
      while (true) {
        for (CacheClientProxy proxy : server.getAcceptor().getCacheClientNotifier()
            .getClientProxies()) {
          HARegion regionForQueue = (HARegion) proxy.getHARegion();

          for (Object obj : regionForQueue.values()) {
            if (obj instanceof HAEventWrapper) {
              Conflatable confObj = (Conflatable) obj;
              if (KEY1.equals(confObj.getKeyToConflate())
                  || KEY2.equals(confObj.getKeyToConflate())) {
                isObjectPresent = true;
              }
            }
          }
        }

        if (isObjectPresent) {
          break; // From while.
        }

        try {
          Thread.sleep(10);
        } catch (InterruptedException e) {
          fail("interrupted", e);
        }
      }
    }
This is the server listener which ensures that regionqueue is properly populated
geode-cq/src/distributedTest/java/org/apache/geode/internal/cache/ha/HADispatcherDistributedTest.java