gpt4 book ai didi

spring-integration - requestMessage 中的负载正在使用出站网关请求中的响应对象进行修改

转载 作者:行者123 更新时间:2023-12-04 07:57:03 25 4
gpt4 key购买 nike

<channel id="shipTypeInfo" />

<int-http:outbound-gateway id="shipInfoGateway"
request-channel="shipTypeInfo"
url="${oms.config.service.provider}omsconfig/shiptype?shipTypeId={shipTypeId}"
http-method="GET" reply-channel="shipTypeInfo"
extract-request-payload="false"
expected-response-type="com.abc.xyz.mac.integration.audit.domain.someInfo">
<int-http:uri-variable name="shipTypeId"
expression="payload" />
</int-http:outbound-gateway>`

在我的服务中使用“整数”输入调用 shipTypeGateway 时,整数值进入负载并正确调用外部服务,但我收到 HTTP: 415 错误。

当我调试时,我观察到:HttpRequestExecutingMessageHandler.handleRequestMessage(Message requestMessage) 调用了 2 次。

第一次,有效负载按预期使用整数并再次在内部调用第二次,但是第二次时间有效负载被响应对象(ShipInfo)修改,这就是为什么它给出响应 HTTP: 415 error

如何使第二次有效负载也应该与整数一起使用。

如有任何帮助,我们将不胜感激。

注意:当前使用的是 Spring-Integration 4.1.6。

最佳答案

嗯,有request-channel="shipTypeInfo" reply-channel="shipTypeInfo"作为一个循环,在我们为第二个调用成功之后,你打算为第三个调用做什么?

所以,你必须重新设计你的逻辑并引入一些router/filter之后<int-http:outbound-gateway>确定您是否需要第二次通话或已经不需要。此外,在下游您将能够transform你的ShipInfo为第二次调用返回整数。

无论如何,我无法用当前的解决方案帮助您解决原始问题。它只是没有意义。

关于spring-integration - requestMessage 中的负载正在使用出站网关请求中的响应对象进行修改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34426586/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com