private void setupCqs() {
    int locatorPort = locator.getPort();
    client.invoke(() -> {
      PoolFactory poolFactory = PoolManager.createFactory().setServerGroup(CQ_GROUP);
      poolFactory.addLocator("localhost", locatorPort);
      poolFactory.setSubscriptionEnabled(true);
      Pool pool = poolFactory.create("DEFAULT");

      QueryService qs = pool.getQueryService();
      CqAttributesFactory cqAf = new CqAttributesFactory();

      try {
        qs.newCq(CQ1, "select * from " + SEPARATOR + STOCKS_REGION, cqAf.create(), true).execute();
        qs.newCq(CQ2, "select * from " + SEPARATOR + STOCKS_REGION + " where id = 1", cqAf.create(),
            true)
            .execute();
        qs.newCq(CQ3, "select * from " + SEPARATOR + STOCKS_REGION + " where id > 2", cqAf.create(),
            true)
            .execute();
      } catch (CqException | CqExistsException | RegionNotFoundException e) {
        throw new RuntimeException(e);
      }
    });
  }
Close the cq from the client-side

@param cqName , Name of the cq which is to be close.
geode-cq/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/DurableClientCommandsDUnitTest.java