要求
本节详细介绍了兼容的 Java 和 Spring Framework 版本。
代码约定
Spring Framework 2.0 引入了对命名空间的支持,这简化了应用程序上下文的 XML 配置,并允许 Spring Integration 提供广泛的命名空间支持。
在本参考指南中,命名空间前缀用于 Spring Integration 的核心命名空间支持。
每个Spring Integration适配器类型(也称为模块)都提供自己的命名空间,该命名空间使用以下约定进行配置:int
下面的示例显示了正在使用的 、 和 命名空间:int
int-event
int-stream
<?xml version="1.0" encoding="UTF-8"?>
<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:int-webflux="http://www.springframework.org/schema/integration/webflux"
xmlns:int-stream="http://www.springframework.org/schema/integration/stream"
xsi:schemaLocation="
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
http://www.springframework.org/schema/integration/webflux
https://www.springframework.org/schema/integration/webflux/spring-integration-webflux.xsd
http://www.springframework.org/schema/integration/stream
https://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd">
…
</beans>
有关 Spring Integration 的命名空间支持的详细说明,请参阅命名空间支持。
可以自由选择命名空间前缀。 您甚至可以选择根本不使用任何命名空间前缀。 因此,您应该应用最适合您的应用程序的约定。 但请注意,SpringSource 工具套件™ (STS) 对 Spring Integration 使用的命名空间约定与本参考指南中使用的相同。 |
可以自由选择命名空间前缀。 您甚至可以选择根本不使用任何命名空间前缀。 因此,您应该应用最适合您的应用程序的约定。 但请注意,SpringSource 工具套件™ (STS) 对 Spring Integration 使用的命名空间约定与本参考指南中使用的相同。 |
本指南中的约定
在某些情况下,为了在指定长完全限定类名时帮助设置格式,我们将缩写为 和 ,例如 。org.springframework
o.s
org.springframework.integration
o.s.i
o.s.i.transaction.TransactionSynchronizationFactory
反馈和贡献
如果您有解决方案或建议的修复方法,可以在 GitHub 上提交拉取请求。 但是,请记住,对于除最微不足道的问题外的所有问题,我们都希望在问题跟踪器中提交票证,在那里进行讨论并留下记录以备将来参考。
有关更多详细信息,请参阅顶级项目 CONCONTRIBUTING 页面上的指南。
开始
如果您刚刚开始使用 Spring Integration,您可能希望从创建基于 Spring Boot 的应用程序开始。 Spring Boot 提供了一种快速(且固执己见)的方法来创建基于 Spring 的生产就绪应用程序。 它基于 Spring 框架,偏向于约定而不是配置,旨在让您尽快启动并运行。
您可以使用 start.spring.io 生成基本项目(添加为依赖项)或遵循“入门”指南之一,例如开始构建集成数据。
除了更容易理解之外,这些指南还非常注重任务,并且大多数都基于Spring Boot。integration