0
votes

In Spring Cloud Dataflow (Stream) what's the right generic way to implement the conditional flow based on a processor output

For example, in below case to have the execution flow through different path based on the product price spit by a transformer.

Example Process Diagram

1

1 Answers

0
votes

You can use the router-sink to dynamically decide where to send the data based on the upstream event-data.

There is a simple SpEL as well as comprehensive support via a Groovy script as options, which can help with decision making and conditions. See README.

If you foresee more complex conditions and process workflows, alternatively, you could build a custom processor that can do the dynamic routing to various downstream named-channel destinations. This approach can also help with unit/IT testing the business-logic standalone.