问题
I am trying to create a stream in Spring Cloud Data Flow with
One source i.e. order-source and Order message will be published to the RabbitMQ Topic/Queue.
Two parallel processors i.e. product-processor and shipment-processor Both of these processors will be subscribers to the RabbitMQ Topic/Queue and gets the Order message and each of them will process these Order message individually and update the Order and the Order message will be published to the RabbitMQ Topic/Queue.
One sink i.e. payment-sink The sink will be the subscriber to the RabbitMQ Topic/Queue and will get the Order message and based on the Order message, will complete the Payment process.
I tried the following command and deployed
stream create --name order-to-payment --definition 'order-source | product-processor|shipment-processor | payment-sink'
But graphically in Spring Cloud Data Flow it looks like as follows:
But I am looking something like below
Is it possible to achieve this? As Spring Cloud Data Flow is not allowing it to connect two processors from one source as well as not able to connect from two processor to one sink graphically?
Thanks, David.
回答1:
You can have DAG with dataflow using named destinations, please check it here: http://docs.spring.io/spring-cloud-dataflow/docs/1.2.2.RELEASE/reference/htmlsingle/#spring-cloud-dataflow-stream-advanced
You will need to send your messages via named destinations and compose the flow from them. Let me know if you have trouble going through the docs and I can post an example here.
来源:https://stackoverflow.com/questions/45125015/create-stream-with-one-source-two-parallel-processors-and-one-sink-in-spring-cl