序言
要求
本节详细介绍了兼容的 Java 和 Spring Framework 版本。
代码约定
Spring Framework 2.0 引入了对命名空间的支持,这简化了应用程序上下文的 XML 配置,并使 Spring Integration 能够提供广泛的命名空间支持。
在本参考指南中,int
命名空间前缀用于 Spring Integration 的核心命名空间支持。每个 Spring Integration 适配器类型(也称为模块)提供自己的命名空间,其配置遵循以下约定
以下示例展示了正在使用的 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 Tool Suite™ (STS) 使用与本参考指南中相同的 Spring Integration 命名空间约定。 |
本指南中的约定
在某些情况下,为了帮助格式化,当指定长完全限定类名时,我们将 org.springframework
缩写为 o.s
,将 org.springframework.integration
缩写为 o.s.i
,例如 o.s.i.transaction.TransactionSynchronizationFactory
。
反馈与贡献
对于操作方法问题或诊断/调试问题,我们建议使用 Stack Overflow。点击此处查看最新问题列表。如果您非常确定 Spring Integration 中存在问题或想提出新功能,请使用 GitHub Issues。
如果您有解决方案或建议的修复,可以在 GitHub 上提交 Pull Request。但请记住,除了最微不足道的问题外,我们期望在问题跟踪器中提交工单,以便进行讨论并留下记录以供将来参考。
更多详情请参阅 CONTRIBUTING 顶级项目页面的指南。
入门
如果您刚开始接触 Spring Integration,可以从创建一个基于 Spring Boot 的应用开始。Spring Boot 提供了一种快速(且带有观点)的方式来创建生产就绪的 Spring 应用。它基于 Spring Framework,倾向于约定优于配置,旨在让您尽快上手并运行起来。
您可以使用 start.spring.io 生成一个基本项目(添加 integration
作为依赖),或者参考其中一个 "入门"指南,例如 构建集成数据的入门指南。这些指南不仅更容易理解,而且非常注重任务,并且大多数都是基于 Spring Boot 的。