Search code examples
spring-cloud-streamspring-cloud-dataflowspring-rabbitspring-cloud-task

How to post a message to a destination from a spring cloud data flow task?


Is there a correct/preferred way to send a message from a Task to a Destination using Spring Cloud Data Flow?

We have an existing stream with destinations, and would like a scheduled task to also feed messages into the stream via one of the destinations.

Options we have considered so far:

  1. Create a new stream with an http source application to feed into the destination, and then use a rest template in the task to post data to the http source. Concern with this approach is that the ip address for the http source could be ephemeral if stream/pod is redeployed.
  2. Manually configure rabbit in the task to send messages directly to the destination (exchange). Concern with this approach is that feels a bit dirty and may be misuse of the underlying messaging system that data flow/streams are using.

Solution

  • I don't see any real issues with #2 but you could also configure an output binding and use the StreamBridge to send to it.

    Sending arbitrary data to an output (e.g. Foreign event-driven sources)