apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/ConfigsExportService.java/ConfigsExportService/writeNamespacesToZip
class ConfigsExportService:  private void writeNamespacesToZip(Stream<ConfigBO> configBOStream, ZipOutputStream zipOutputStream) {
    final Consumer<ConfigBO> configBOConsumer =
        configBO -> {
          try {
            synchronized (zipOutputStream) {
              String appId = configBO.getAppId();
              String clusterName = configBO.getClusterName();
              String namespace = configBO.getNamespace();
              String configFileContent = configBO.getConfigFileContent();
              ConfigFileFormat configFileFormat = configBO.getFormat();

              String
                  configFileName =
                  ConfigFileUtils.toFilename(appId, clusterName, namespace, configFileFormat);
              String filePath =
                  ConfigFileUtils.genNamespacePath(configBO.getOwnerName(), appId, configBO.getEnv(), configFileName);

              writeToZip(filePath, configFileContent, zipOutputStream);
            }
          } catch (IOException e) {
            logger.error("Write error. {}", configBO);
            throw new ServiceException("Write namespace error. {}", e);
          }
        };

    configBOStream.forEach(configBOConsumer);
  }