Binder Detection

Spring Cloud Stream 依赖于 Binder SPI 的实现,将用户代码与消息代理进行连接的任务。 每个 Binder 实现通常连接到一种消息系统。spring-doc.cadn.net.cn

<h2>类路径检测</h2>

默认情况下,Spring Cloud Stream 依赖于 Spring Boot 的自动配置来配置绑定过程。 如果在类路径上发现一种 Binder 实现,Spring Cloud Stream 会自动使用它。 例如,一个只绑定到 RabbitMQ 的 Spring Cloud Stream 项目可以添加以下依赖:spring-doc.cadn.net.cn

<dependency>
  <groupId>org.springframework.cloud</groupId>
  <artifactId>spring-cloud-stream-binder-rabbit</artifactId>
</dependency>

针对其他 binder 依赖的特定 Maven 坐标,请参见该 binder 实现的文档。spring-doc.cadn.net.cn