|
这个版本仍在开发中,尚未达到稳定状态。要使用最新稳定版,请使用 spring-cloud-stream 5.0.1 ! |
Binder Detection
Spring Cloud Stream 依赖于 Binder SPI 的实现,将用户代码与消息代理进行连接的任务。 每个 Binder 实现通常连接到一种消息系统。
<h2>类路径检测</h2>
默认情况下,Spring Cloud Stream 依赖于 Spring Boot 的自动配置来配置绑定过程。 如果在类路径上发现一种 Binder 实现,Spring Cloud Stream 会自动使用它。 例如,一个只绑定到 RabbitMQ 的 Spring Cloud Stream 项目可以添加以下依赖:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-binder-rabbit</artifactId>
</dependency>
针对其他 binder 依赖的特定 Maven 坐标,请参见该 binder 实现的文档。