Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Cloud Stream - Send and receive synchronized

In my spring boot rest controller, I'm using StreamBridge for sending a message to the rabbitMQ server with something like

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

Is there a way to do a send and wait the response ?

like image 691
tweetysat Avatar asked Jun 18 '26 11:06

tweetysat


1 Answers

Alright, as I said, late to the party, but there seems to be a way. simply you can make the producer synchronous, this can be done in application.properties as such:

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

The same configuration was originally working for the MessageChannel pre Spring cloud function, but as I understand the underlying functionality is already the same

like image 106
WiredCoder Avatar answered Jun 21 '26 22:06

WiredCoder



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!