Spring Cloud DataFlow for HTTP request/response ex

2019-07-28 20:54发布

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条回答
老娘就宠你
2楼-- · 2019-07-28 21:40

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.

查看更多
登录 后发表回答