private void createAsyncEventQueueWithGatewayEventFilter(String asyncEventQueueId,
      AsyncEventListener asyncEventListener,
      GatewayEventFilter gatewayEventFilter,
      String diskStoreName,
      boolean isDiskSynchronous,
      int dispatcherThreads,
      boolean isParallel) {
    assertThat(asyncEventQueueId).isNotNull();
    assertThat(asyncEventListener).isNotNull();
    assertThat(gatewayEventFilter).isNotNull();
    assertThat(diskStoreName).isNotNull();

    createDiskStore(diskStoreName, asyncEventQueueId);

    AsyncEventQueueFactory asyncEventQueueFactory = getCache().createAsyncEventQueueFactory();
    asyncEventQueueFactory.setDiskStoreName(diskStoreName);
    asyncEventQueueFactory.setDiskSynchronous(isDiskSynchronous);
    asyncEventQueueFactory.setDispatcherThreads(dispatcherThreads);
    asyncEventQueueFactory.addGatewayEventFilter(gatewayEventFilter);
    asyncEventQueueFactory.setParallel(isParallel);
    asyncEventQueueFactory.setPersistent(true);

    asyncEventQueueFactory.create(asyncEventQueueId, asyncEventListener);
  }
Override as needed to add to the configuration, such as regionFactory.setOffHeap(boolean).
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/wan/asyncqueue/AsyncEventListenerWithFilterDistributedTest.java