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