Spring Cloud DataFlow for HTTP request/response exchange

房东的猫 提交于 2019-12-02 09:36:20

问题


I would like to use streams to handle an HTTP request/response exchange. I didn't see any Spring Cloud Stream App Starters with HTTP sink functionality. Will I need to build a custom sink to handle the response? If so, do I pass the request through my processing pipeline, then use the request in my sink to form the response? I don't think I've misunderstood the use case of Spring Cloud DataFlow and Spring Cloud Stream. Perhaps there are app starters available for this pattern.


回答1:


Spring Cloud Stream/Dataflow is for unidirectional (stream) processing; it is not intended for request/reply processing.

You could, however, utilize a Stream from a Spring Integration Application; for example, with the rabbitmq binder...

http-inbound-gateway -> amqp-outbound-gateway

Where the outbound gateway is configured to expect the reply from a specific queue and then your stream could be...

:requestQueue > processor1 | ... | processorn > :replyQueue

Spring Integration doesn't currently have an outbound gateway for Kafka. I opened an issue.



来源:https://stackoverflow.com/questions/43307078/spring-cloud-dataflow-for-http-request-response-exchange

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