2

在我的 Spring Boot 休息控制器中,我使用 StreamBridge 向 rabbitMQ 服务器发送消息,例如

streamBridge.send("consumer-in-0", "hello world");

有没有办法做一个send and wait the response

4

1 回答 1

0

好吧,正如我所说,聚会迟到了,但似乎有办法。只需您可以使生产者同步,这可以在 application.properties 中完成,如下所示:

spring.cloud.stream.kafka.bindings.functionName-out-0.producer.sync=true

相同的配置最初适用于 MessageChannel pre Spring 云功能,但据我了解,底层功能已经相同

于 2021-11-30T11:31:35.757 回答