# 集成端点

## 端点快速参考表

正如前面几节中所讨论的， Spring 集成提供了许多端点，这些端点用于与外部系统、文件系统和其他系统进行接口。

对于透明的依赖管理 Spring，集成提供了要导入到 Maven 配置中的材料清单 POM:

```
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.integration</groupId>
            <artifactId>spring-integration-bom</artifactId>
            <version>5.5.9</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>
```

总结一下：

* 入站通道适配器用于单向集成，以将数据带入消息传递应用程序。

* 出站通道适配器用于单向集成，以将数据发送到消息传递应用程序之外。

* 入站网关用于双向集成流，其中其他一些系统调用消息传递应用程序并接收答复。

* 出站网关用于双向集成流，其中消息传递应用程序调用某些外部服务或实体并期望得到结果。

下表总结了各种端点，并提供了与相应章节的快速链接。

|     Module     |                                                                                                                                                            Inbound Adapter                                                                                                                                                             |出站适配器|                            Inbound Gateway                            |                                                                 Outbound Gateway                                                                  |
|----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------|
|    **AMQP**    |                                                                                                                                  [Inbound Channel Adapter](./amqp.html#amqp-inbound-channel-adapter)                                                                                                                                   |[出站通道适配器](./amqp.html#amqp-outbound-channel-adapter)|          [Inbound Gateway](./amqp.html#amqp-inbound-gateway)          |                                               [Outbound Gateway](./amqp.html#amqp-outbound-gateway)                                               |
|   **Events**   |                                                                                                                                  [Receiving Spring Application Events](./event.html#appevent-inbound)                                                                                                                                  |[Sending Spring Application Events](./event.html#appevent-outbound)|                                   N                                   |                                                                         N                                                                         |
|    **Feed**    |                                                                                                                                [Feed Inbound Channel Adapter](./feed.html#feed-inbound-channel-adapter)                                                                                                                                |                                                                                                                                                                       N                                                                                                                                                                       |                                   N                                   |                                                                         N                                                                         |
|    **File**    |                                                                                                                       [Reading Files](./file.html#file-reading) and ['tail’ing Files](./file.html#file-tailing)                                                                                                                        |[写入文件](./file.html#file-writing)|                                   N                                   |                                                     [Writing files](./file.html#file-writing)                                                     |
|   **FTP(S)**   |                                                                                                                                         [FTP Inbound Channel Adapter](./ftp.html#ftp-inbound)                                                                                                                                          |[FTP 出站通道适配器](./ftp.html#ftp-outbound)|                                   N                                   |                                              [FTP Outbound Gateway](./ftp.html#ftp-outbound-gateway)                                              |
|  **Gemfire**   |                                                                                                  [Inbound Channel Adapter](./gemfire.html#gemfire-inbound) and [Continuous Query Inbound Channel Adapter](./gemfire.html#gemfire-cq)                                                                                                   |[出站通道适配器](./gemfire.html#gemfire-outbound)|                                   N                                   |                                                                         N                                                                         |
|    **HTTP**    |                                                                                                                                          [HTTP Namespace Support](./http.html#http-namespace)                                                                                                                                          |[HTTP 命名空间支持](./http.html#http-namespace)|          [Http Inbound Components](./http.html#http-inbound)          |                                               [HTTP Outbound Components](./http.html#http-outbound)                                               |
|    **JDBC**    |                                                                                [Inbound Channel Adapter](./jdbc.html#jdbc-inbound-channel-adapter) and [Stored Procedure Inbound Channel Adapter](./jdbc.html#stored-procedure-inbound-channel-adapter)                                                                                |[出站通道适配器](./jdbc.html#jdbc-outbound-channel-adapter)和[存储过程出站通道适配器](./jdbc.html#stored-procedure-outbound-channel-adapter)|                                   N                                   |   [Outbound Gateway](./jdbc.html#jdbc-outbound-gateway) and [Stored Procedure Outbound Gateway](./jdbc.html#stored-procedure-outbound-gateway)    |
|    **JMS**     |                                                                                         [Inbound Channel Adapter](./jms.html#jms-inbound-channel-adapter) and [Message-driven Channel Adapter](./jms.html#jms-message-driven-channel-adapter)                                                                                          |[出站通道适配器](./jms.html#jms-outbound-channel-adapter)|           [Inbound Gateway](./jms.html#jms-inbound-gateway)           |                                                [Outbound Gateway](./jms.html#jms-outbound-gateway)                                                |
|    **JMX**     |                                 [Notification-listening Channel Adapter](./jmx.html#jmx-notification-listening-channel-adapter) and [Attribute-polling Channel Adapter](./jmx.html#jmx-attribute-polling-channel-adapter) and [Tree-polling Channel Adapter](./jmx.html#tree-polling-channel-adapter)                                  |[通知发布通道适配器](./jmx.html#jmx-notification-publishing-channel-adapter)和[操作调用通道适配器](./jmx.html#jmx-operation-invoking-channel-adapter)|                                   N                                   |                             [Operation-invoking Outbound Gateway](./jmx.html#jmx-operation-invoking-outbound-gateway)                             |
|    **JPA**     |                                                                                                                                   [Inbound Channel Adapter](./jpa.html#jpa-inbound-channel-adapter)                                                                                                                                    |[出站通道适配器](./jpa.html#jpa-outbound-channel-adapter)|                                   N                                   |[Updating Outbound Gateway](./jpa.html#jpa-updating-outbound-gateway) and [Retrieving Outbound Gateway](./jpa.html#jpa-retrieving-outbound-gateway)|
|**Apache Kafka**|                                                                                                    [Message Driven Channel Adapter](./kafka.html#kafka-inbound) and [Inbound Channel Adapter](./kafka.html#kafka-inbound-pollable)                                                                                                     |[出站通道适配器](./kafka.html#kafka-outbound)|         [Inbound Gateway](./kafka.html#kafka-inbound-gateway)         |                                              [Outbound Gateway](./kafka.html#kafka-outbound-gateway)                                              |
|    **Mail**    |                                                                                                                                       [Mail-receiving Channel Adapter](./mail.html#mail-inbound)                                                                                                                                       |[邮件发送通道适配器](./mail.html#mail-outbound)|                                   N                                   |                                                                         N                                                                         |
|  **MongoDB**   |                                                                                                                           [MongoDB Inbound Channel Adapter](./mongodb.html#mongodb-inbound-channel-adapter)                                                                                                                            |[MongoDB 出站通道适配器](./mongodb.html#mongodb-outbound-channel-adapter)|                                   N                                   |                                                                         N                                                                         |
|    **MQTT**    |                                                                                                                                  [Inbound (Message-driven) Channel Adapter](./mqtt.html#mqtt-inbound)                                                                                                                                  |[出站通道适配器](./mqtt.html#mqtt-outbound)|                                   N                                   |                                                                         N                                                                         |
|   **R2DBC**    |                                                                                                                              [R2DBC Inbound Channel Adapter](./r2dbc.html#r2dbc-inbound-channel-adapter)                                                                                                                               |[R2DBC 出站通道适配器](./r2dbc.html#r2dbc-outbound-channel-adapter)|                                   N                                   |                                                                         N                                                                         |
|   **Redis**    |[Redis Inbound Channel Adapter](./redis.html#redis-inbound-channel-adapter), [Redis Queue Inbound Channel Adapter](./redis.html#redis-queue-inbound-channel-adapter), [Redis Store Inbound Channel Adapter](./redis.html#redis-store-inbound-channel-adapter), [Redis Stream Inbound Channel Adapter](./redis.html#redis-stream-inbound)|[Redis 出站通道适配器](./redis.html#redis-outbound-channel-adapter), [Redis 队列出站通道适配器](./redis.html#redis-queue-outbound-channel-adapter), [恢复存储出站通道适配器](./redis.html#redis-store-outbound-channel-adapter), [Redis 流出站通道适配器](./redis.html#redis-stream-outbound)|[Redis Queue Inbound Gateway](./redis.html#redis-queue-inbound-gateway)|[Redis Outbound Command Gateway](./redis.html#redis-outbound-gateway) and [Redis Queue Outbound Gateway](./redis.html#redis-queue-outbound-gateway)|
|  **Resource**  |                                                                                                                          [Resource Inbound Channel Adapter](./resource.html#resource-inbound-channel-adapter)                                                                                                                          |                                                                                                                                                                       N                                                                                                                                                                       |                                   N                                   |                                                                         N                                                                         |
|    **RMI**     |                                                                                                                                                                   N                                                                                                                                                                    |                                                                                                                                                                       N                                                                                                                                                                       |                 [Inbound RMI](./rmi.html#rmi-inbound)                 |                                                      [Outbound RMI](./rmi.html#rmi-outbound)                                                      |
|  **RSocket**   |                                                                                                                                                                   N                                                                                                                                                                    |                                                                                                                                                                       N                                                                                                                                                                       |       [RSocket Inbound Gateway](./rsocket.html#rsocket-inbound)       |                                            [RSocket Outbound Gateway](./rsocket.html#rsocket-outbound)                                            |
|    **SFTP**    |                                                                                                                                        [SFTP Inbound Channel Adapter](./sftp.html#sftp-inbound)                                                                                                                                        |[SFTP 出站通道适配器](./sftp.html#sftp-outbound)|                                   N                                   |                                            [SFTP Outbound Gateway](./sftp.html#sftp-outbound-gateway)                                             |
|   **STOMP**    |                                                                                                                                  [STOMP Inbound Channel Adapter](./stomp.html#stomp-inbound-adapter)                                                                                                                                   |[Stomp 出站通道适配器](./stomp.html#stomp-outbound-adapter)|                                   N                                   |                                                                         N                                                                         |
|   **Stream**   |                                                                                                                                          [Reading from Streams](./stream.html#stream-reading)                                                                                                                                          |[写到流](./stream.html#stream-writing)|                                   N                                   |                                                                         N                                                                         |
|   **Syslog**   |                                                                                                                                 [Syslog Inbound Channel Adapter](./syslog.html#syslog-inbound-adapter)                                                                                                                                 |                                                                                                                                                                       N                                                                                                                                                                       |                                   N                                   |                                                                         N                                                                         |
|    **TCP**     |                                                                                                                                                 [TCP Adapters](./ip.html#tcp-adapters)                                                                                                                                                 |[TCP 适配器](./ip.html#tcp-adapters)|                [TCP Gateways](./ip.html#tcp-gateways)                 |                                                      [TCP Gateways](./ip.html#tcp-gateways)                                                       |
|    **UDP**     |                                                                                                                                                 [UDP Adapters](./ip.html#udp-adapters)                                                                                                                                                 |[UDP 适配器](./ip.html#udp-adapters)|                                   N                                   |                                                                         N                                                                         |
|  **WebFlux**   |                                                                                                                                   [WebFlux Inbound Channel Adapter](./webflux.html#webflux-inbound)                                                                                                                                    |[WebFlux 出站通道适配器](./webflux.html#webflux-outbound)|       [Inbound WebFlux Gateway](./webflux.html#webflux-inbound)       |                                            [Outbound WebFlux Gateway](./webflux.html#webflux-outbound)                                            |
|**Web Services**|                                                                                                                                                                   N                                                                                                                                                                    |                                                                                                                                                                       N                                                                                                                                                                       |     [Inbound Web Service Gateways](./ws.html#webservices-inbound)     |                                          [Outbound Web Service Gateways](./ws.html#webservices-outbound)                                          |
|**Web Sockets** |                                                                                                                           [WebSocket Inbound Channel Adapter](./web-sockets.html#web-socket-inbound-adapter)                                                                                                                           |[WebSocket Outbound Channel Adapter](./web-sockets.html#web-socket-outbound-adapter)|                                   N                                   |                                                                         N                                                                         |
|    **XMPP**    |                                                                                                                       [XMPP Messages](./xmpp.html#xmpp-messages) and [XMPP Presence](./xmpp.html#xmpp-presence)                                                                                                                        |[XMPP 消息](./xmpp.html#xmpp-messages)和[XMPP 存在](./xmpp.html#xmpp-presence)|                                   N                                   |                                                                         N                                                                         |
|   **ZeroMQ**   |                                                                                                                             [ZeroMQ Inbound Channel Adapter](./zeromq.html#zeromq-inbound-channel-adapter)                                                                                                                             |[ZeroMQ 出站通道适配器](./zeromq.html#zeromq-outbound-channel-adapter)|                                   N                                   |                                                                         N                                                                         |

此外，如[核心消息传递](./core.html#spring-integration-core-messaging)中所讨论的， Spring 集成提供了与普通旧 Java 对象接口的端点。正如[通道适配器](./channel-adapter.html#channel-adapter)中所讨论的，`<int:inbound-channel-adapter>`元素允许你轮询 Java 方法中的数据。`<int:outbound-channel-adapter>`元素允许你将数据发送到`void`方法。正如[消息传递网关](./gateway.html#gateway)中所讨论的，`<int:gateway>`元素允许任何 Java 程序调用消息流。所有这些都可以工作，而不需要对 Spring 集成有任何源码级依赖。在此上下文中，相当于出站网关的方法是使用服务激活器（参见[服务激活器](./service-activator.html#service-activator)）来调用返回某种类型的`Object`的方法。

从版本`5.2.2`开始，所有入站网关都可以配置`errorOnTimeout`布尔标志，以便在下游流在回复超时期间不返回回复时抛出`MessageTimeoutException`。在线程将控制权返回到网关之前，计时器不会启动，因此通常只有在下游流是异步的或者由于某些处理程序返回`null`而停止时，计时器才有用，例如[filter](./filter.html#filter)。这样的异常可以在`errorChannel`流上进行处理，例如，为请求客户端生成补偿应答。