Sample code for request/reply design by using Spring Cloud Stream

Hi @as63010,

Great, glad it’s working for you! I think this pattern works pretty well but you’ll just want to be cautious that the event you receive always has a “ReplyToBindingName” that will match the config of your app. It feels a bit too coupled for my liking…I think I’d go a different route.

There aren’t many examples out there as it’s a new enhancement in 2021, but StreamBridge also offers a method where you can specify the binder you want to send to. Check it out here. If you were to go this route then your inbound messages can just specify a topic to reply on (which could be dynamic and allow you to handle an infinite amount of them) and then your app just needs to have some logic to know what binder to send to. Make sense?