用于 HTTP 请求/响应交换的 Spring Cloud DataFlow [英] Spring Cloud DataFlow for HTTP request/response exchange

查看:52
本文介绍了用于 HTTP 请求/响应交换的 Spring Cloud DataFlow的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用流来处理 HTTP 请求/响应交换.我没有看到任何具有 HTTP 接收器功能的 Spring Cloud Stream App Starters.我是否需要构建一个自定义接收器来处理响应?如果是这样,我是否通过我的处理管道传递请求,然后使用我的接收器中的请求来形成响应?我认为我没有误解 Spring Cloud DataFlow 和 Spring Cloud Stream 的用例.也许有适用于这种模式的应用启动器.

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.

推荐答案

Spring Cloud Stream/Dataflow 用于单向(流)处理;它不用于请求/回复处理.

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

但是,您可以使用来自 Spring 集成应用程序的流;例如,使用rabbitmq活页夹...

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 目前没有用于 Kafka 的出站网关.我打开了一个问题.

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

这篇关于用于 HTTP 请求/响应交换的 Spring Cloud DataFlow的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆