Preface

本章包括:

This chapter includes:

Requirements

本节详细介绍了兼容的 JavaSpring Framework 版本。

This section details the compatible Java and Spring Framework versions.

Compatible Java Versions

对于 Spring Integration 6.3.x,最低兼容的 Java 版本是 Java SE 17。不支持更早的 Java 版本。

For Spring Integration 6.3.x, the minimum compatible Java version is Java SE 17. Older versions of Java are not supported.

Compatible Versions of the Spring Framework

Spring Integration 6.3.x 需要 Spring Framework 6.1 或更高版本。

Spring Integration 6.3.x requires Spring Framework 6.1 or later.

Code Conventions

Spring Framework 2.0 引入了对命名空间的支持,这简化了应用程序上下文的 XML 配置,并让 Spring Integration 提供广泛的命名空间支持。

Spring Framework 2.0 introduced support for namespaces, which simplifies the XML configuration of the application context and lets Spring Integration provide broad namespace support.

在本参考指南中,int 命名空间前缀用于 Spring Integration 的核心命名空间支持。每个 Spring Integration 适配器类型(也称为模块)都提供自己的命名空间,该命名空间使用以下约定进行配置:

In this reference guide, the int namespace prefix is used for Spring Integration’s core namespace support. Each Spring Integration adapter type (also called a module) provides its own namespace, which is configured by using the following convention:

下面的示例展示了 intint-eventint-stream 命名空间的使用:

The following example shows the int, int-event, and int-stream namespaces in use:

<?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 命名空间支持的详细说明,请参阅 Namespace Support

For a detailed explanation regarding Spring Integration’s namespace support, see Namespace Support.

可以自由选择名称空间前缀。您甚至可以选择根本不使用任何名称空间前缀。因此,您应当应用最适合您应用程序的约定。不过要注意的是,SpringSource Tool Suite™ (STS) 对 Spring Integration 使用的名称空间约定与本参考指南中使用的相同。

The namespace prefix can be freely chosen. You may even choose not to use any namespace prefixes at all. Therefore, you should apply the convention that best suits your application. Be aware, though, that SpringSource Tool Suite™ (STS) uses the same namespace conventions for Spring Integration as used in this reference guide.

Conventions in This Guide

在某些情况下,为了在指定很长的完全限定类名时帮助格式化,我们将 org.springframework 缩写为 o.s,将 org.springframework.integration 缩写为 o.s.i,例如,o.s.i.transaction.TransactionSynchronizationFactory

In some cases, to aid formatting when specifying long fully qualified class names, we shorten org.springframework to o.s and org.springframework.integration to o.s.i, such as with o.s.i.transaction.TransactionSynchronizationFactory.

Feedback and Contributions

对于如何解决问题、诊断或调试问题,我们建议使用 Stack Overflow。单击 here 以获取最新问题列表。如果您比较确定 Spring Integration 中存在问题,或者想要提出一个新功能,请使用 GitHub Issues

For how-to questions or diagnosing or debugging issues, we suggest using Stack Overflow. Click here for a list of the latest questions. If you’re fairly certain that there is a problem in the Spring Integration or would like to suggest a feature, please use the GitHub Issues.

如果您心中已有解决方案或建议的修复方案,则可以提交拉取请求到 GitHub。但是,请记住,对于所有最基本的问题,我们希望在问题跟踪器中提交工单,其中会进行讨论并为将来的参考留下记录。

If you have a solution in mind or a suggested fix, you can submit a pull request on GitHub. However, please keep in mind that, for all but the most trivial issues, we expect a ticket to be filed in the issue tracker, where discussions take place and leave a record for future reference.

有关更多详细信息,请参阅 CONTRIBUTING、顶级项目页上的指南。

For more details see the guidelines at the CONTRIBUTING, top-level project page.

Getting Started

如果您刚刚开始使用 Spring Integration,则可能想要通过创建基于 Spring Boot 的应用程序开始。Spring Boot 提供了一种快速(且主观的)方法来创建基于 Spring 的可用于生产环境的应用程序。它基于 Spring Framework,奉行惯例优于配置,并且旨在让您尽快启动并运行。

If you are just getting started with Spring Integration, you may want to begin by creating a Spring Boot-based application. Spring Boot provides a quick (and opinionated) way to create a production-ready Spring-based application. It is based on the Spring Framework, favors convention over configuration, and is designed to get you up and running as quickly as possible.

您可以使用 start.spring.io 生成一个基本项目(添加 integration 作为依赖项),或者按照其中一个 "Getting Started" guides,如 Getting Started Building an Integrating Data。这些指南除了比较容易理解之外,还非常注重于任务,且大多数是以 Spring Boot 为基础的。

You can use start.spring.io to generate a basic project (add integration as dependency) or follow one of the "Getting Started" guides, such as Getting Started Building an Integrating Data. As well as being easier to digest, these guides are very task focused, and most of them are based on Spring Boot.