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:
- 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.
- 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.
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)