private void addCacheListenerOnQueueBucketRegion(String senderId, int numBuckets) {
    GatewaySender sender = getGatewaySender(senderId);
    RegionQueue parallelQueue =
        ((AbstractGatewaySender) sender).getQueues().toArray(new RegionQueue[1])[0];

    PartitionedRegion region = (PartitionedRegion) parallelQueue.getRegion();
    for (int i = 0; i < numBuckets; i++) {
      BucketRegion br = region.getBucketRegion(i);
      if (br != null) {
        @SuppressWarnings("unchecked")
        AttributesMutator<Object, Object> mutator = br.getAttributesMutator();
        CacheListener<Object, Object> listener = new QueueListener<>();
        mutator.addCacheListener(listener);
      }
    }

  }
Returns a Map that contains the count for number of cache server and number of Receivers.
geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/WANTestBase.java