Create Stream with one source, two parallel processors and one sink in Spring Cloud Data Flow

别说谁变了你拦得住时间么 提交于 2020-01-04 02:33:35

问题


I am trying to create a stream in Spring Cloud Data Flow with

  1. One source i.e. order-source and Order message will be published to the RabbitMQ Topic/Queue.

  2. 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.

  3. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!