I have a function publish
for which I've defined the binding too
@Bean
public Function<ProducerPayload<T>, Message<ProducerPayload<T>>> publish() {
// some magic here
}
the config properties:
spring.cloud.function.definition=publish
and
spring.cloud.stream.bindings.publish-out-0.destination=${category}-${spring.application.name}-${runtime-env}
When I call this via streamBridge I call the publish-in-0 binding
streamBridge.send("publish-in-0", "kafka", ProducerPayload.builder().event(event).content(entity).build(), MimeType.valueOf("application/json"));
this leads to creation of a Kafka topic publish-in-0
which is always empty, the message however does land up in the right topic as defined in the publish-out-0
destination. Why is this topic getting created? I was assuming a message channel by that name is registered and invoked by spring boot cloud stream.