1

My requirement is similar to the question in Content based routing using Spring Cloud Dataflow. I wanted a router app which will dispatch messages to specific handler app based on the payload.

Flow is like below.

enter image description here

1 Answers1

3

You can still construct a stream that looks like the above(what you mentioned in your question) using the named destinations and the router sink application in Spring Cloud Data Flow.

For instance, you would have a set of streams as follows:

stream create http-router --definition "http | router"

Based on the content from http source application, the router sink application would create the appropriate middleware components (exchange - in case of RabbitMQ, topic in case of Apache Kafka etc.,) created by the router sink applications. Once you have these middleware components you can use the named destinations to construct the streaming applications from there.

Let's assume you use Apache Kafka and based on the http content and we have destination-1 and destination-2 as the new topics created by the router, you can construct the streams as follows:

stream create processor1 --definition ":destination1 > Transform_1 > :final_message"
stream create processor2 --definition ":destination2 > Transform_2 > :final_message"

The above streams would serve the same purpose that the stream you posted above.

The inherent advantage of using named destinations is that you can create as many streams you would like (this is due to the consumer group model of the middleware infrastructure created - topic, exchange etc.,).

Ilayaperumal Gopinathan
  • 4,099
  • 1
  • 13
  • 12