apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/ConfigsExportService.java/ConfigsExportService/exportAppNamespaces
class ConfigsExportService:  private void exportAppNamespaces(ZipOutputStream zipOutputStream) {
    List<AppNamespace> appNamespaces = appNamespaceService.findAll();

    logger.info("to import appnamespace size = " + appNamespaces.size());

    Consumer<AppNamespace> appNamespaceConsumer = appNamespace -> {
      try {
        synchronized (zipOutputStream) {
          String fileName = ConfigFileUtils.genAppNamespaceInfoPath(appNamespace);
          String content = gson.toJson(appNamespace);

          writeToZip(fileName, content, zipOutputStream);
        }
      } catch (Exception e) {
        logger.error("Write appnamespace error. {}", appNamespace);
        throw new IllegalStateException(e);
      }
    };

    appNamespaces.forEach(appNamespaceConsumer);

  }