Search code examples
spring-cloud-streamspring-cloud-dataflow

Spring Cloud Stream Router Sink -- then what?


I've created a Spring Cloud Dataflow that uses the router sink app from the Spring Cloud Stream starter apps. I'm using the one with RabbitMQ bindings. That automatically creates RabbitMQ Exchanges (type: topic) with the results of my router expressions. I think the next step is to create new Dataflows for each of those router results. However, the rabbit source starter app can only be configured to read from a queue. Of course, I can manually create queues and bind them to the automatically created exchanges, but is that what I'm supposed to do? Or is there some configuration I'm missing that would cause the queues to be automatically created and bound?


Solution

  • The Rabbit source app is intended to consume from existing infrastructure - the queue has to exist already (similar to the sink).

    To use data flow to consume from a dynamically created destination, you can use Named Destinations.

    stream create fromDynDest --definition=":myRoutedDest > process1 | process2 | sink"
    

    or even

    stream create fromDynDest --definition=":myRoutedDest > sink"