I want to update an application that uses Spring Cloud stream with a deprecated annotations approach to functional style.
I already use the legacy approach for classical RabbitMQ producer and consumer, but since in the Spring Cloud Stream 4.x annotation approach was removed I need to migrate to a functional model.
According to documentation for send arbitrary data I can use StreamBridge
but I also need to have advantages that provide Spring Cloud Stream provides for classical binder like: auto creation topic, producer configuration e.t.c.
So again according to documentation I can use spring.cloud.stream.output-bindings
property for pre-create an output binding at the initialization as a result I have configuration line in the example.
spring:
cloud:
stream:
output-bindings: test
bindings:
test-out-0:
contentType: application/json
rabbit:
bindings:
test-out-0:
producer:
delivery-mode: non-persistent
transacted: true
But this not works for me since I have come functional beans in some internal libraries which are found by FunctionCatalog.lookup
method so pre-creation of topic will be skipped.
P.S. spring.cloud.stream.function.autodetect
and also doesn't work