此版本仍在开发中,尚不被认为是稳定的。对于最新的稳定版本,请使用 Spring Batch 文档 5.2.2spring-doc.cadn.net.cn

命名空间支持

在 1.3 版中,Spring Batch Integration 添加了专用的 XML 命名空间支持, 旨在提供更简单的配置 经验。要使用命名空间,请添加以下内容 命名空间声明到您的 Spring XML 应用程序上下文 文件:spring-doc.cadn.net.cn

<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:batch-int="http://www.springframework.org/schema/batch-integration"
  xsi:schemaLocation="
    http://www.springframework.org/schema/batch-integration
    https://www.springframework.org/schema/batch-integration/spring-batch-integration.xsd">

    ...

</beans>

以下示例显示了用于 Spring 的完全配置的 Spring XML 应用程序上下文文件 批量集成:spring-doc.cadn.net.cn

<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:int="http://www.springframework.org/schema/integration"
  xmlns:batch="http://www.springframework.org/schema/batch"
  xmlns:batch-int="http://www.springframework.org/schema/batch-integration"
  xsi:schemaLocation="
    http://www.springframework.org/schema/batch-integration
    https://www.springframework.org/schema/batch-integration/spring-batch-integration.xsd
    http://www.springframework.org/schema/batch
    https://www.springframework.org/schema/batch/spring-batch.xsd
    http://www.springframework.org/schema/beans
    https://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/integration
    https://www.springframework.org/schema/integration/spring-integration.xsd">

    ...

</beans>

将版本号附加到引用的 XSD 文件也是 允许。但是,由于无版本声明始终使用 latest schema,我们通常不建议附加版本 number 添加到 XSD 名称。添加版本号 更新 Spring Batch 时可能会产生问题 集成依赖项,因为它们可能需要更新版本 XML 模式的。spring-doc.cadn.net.cn