此版本仍在开发中,尚未被视为稳定版本。对于最新的稳定版本,请使用 spring-cloud-stream 4.1.4! |
连接多个应用程序实例
虽然 Spring Cloud Stream 使单个 Spring Boot 应用程序可以轻松连接到消息传递系统,但 Spring Cloud Stream 的典型场景是创建多应用程序管道,其中微服务应用程序相互发送数据。 您可以通过关联 “相邻” 应用程序的输入和输出目标来实现此方案。
假设一个设计要求 Time Source 应用程序将数据发送到 Log Sink 应用程序。您可以使用名为ticktock
用于两个应用程序内的绑定。
Time Source(具有名为output
) 将设置以下属性:
spring.cloud.stream.bindings.output.destination=ticktock
Log Sink(具有名为input
) 将设置以下属性:
spring.cloud.stream.bindings.input.destination=ticktock