'Spring Cloud Stream RabbitMQ wait for publisher confirms

I am using Spring Cloud Stream with the RabbitMQ binder. I use the StreamBridge to send messages to a destination. I want to send a message with StreamBridge and after that synchronously wait for the publisher confirm (to make sure the message was received by the broker). Is that possible using Spring Cloud Stream? I have found the RabbitTemplate's waitForConfirms method and i have publisherConfirmType: simple and publisherReturns: true set in my configuration. But i don't know how to access the method with the RabbitTemplate since i don't use it because i'm using the StreamBridge. If i Autowire a RabbitTemplate and call waitForConfirms after my StreamBridge send call, it waits forever (nothing happens). I'm looking for an option like with the Kafka binder. There you can set the Producer to "sync" and "requiredAcks" to 1 to wait for publisher acks.

Thanks for any help!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source