Search code examples
spring-cloud-stream

Producer configurations for PublishConfirm


I am trying to figure out if there is a way to configure PublishConfirm behaviour when building producers using Spring Cloud Stream apps. I understand that there are two ways to build producers - Supplier and StreamBridge. So is there any configuration or api calls to alter the PublishConfirm configurations via SCSt in the above two mechanisms.

I have looked into SpringCloudStream documentation, but the examples are mainly related to amqp implementations and not SCSt.


Solution

  • The publish-confirm is really just a RabbitMQ feature: https://rabbitmq-website.pages.dev/tutorials/tutorial-seven-java. So, it is not a surprise that it can be enabled only on the producers with RabbitMQ binder. There are respective auto-configuration properties to enable this feature:

    spring.rabbitmq.publisher-confirm-type=correlated
    

    See more info in Spring AMQP docs: https://docs.spring.io/spring-amqp/reference/amqp/connections.html#cf-pub-conf-ret