Kanika Sharma
Kanika Sharma

Reputation: 11

Content based routing using Spring Cloud Dataflow

I need to achieve content based routing and filtering using Spring Cloud Dataflow.

For e.g. If the input to my processor is a String. If the String contains say xyz I need to pass it to component/step X in my Spring Cloud Stream; otherwise I want it to go to component/step Y of my Stream.

I know router-sink can be used to achieve the same; however I wanted to use the routing\decision making as a processor; because my decision making apps are the processors in my Stream.

What is the best way to achieve the same?

Upvotes: 0

Views: 504

Answers (1)

sobychacko
sobychacko

Reputation: 5914

If you are using StreamListener in your processor, you can have multiple methods annotated with StreamListener taking a String argument, then using the conditional support to determine where to send (route) the information to. Here is the relevant section for this from the docs. Although it is talking about different POJO's, you can extend the concept to what you are trying to accomplish.

Upvotes: 1

Related Questions