Spring Integration HttpServerErrorException$InternalServerError:500:超时内未收到回复
我正在尝试使用窃听将一些数据复制到另一个通道。这是我的代码:
@Bean
public IntegrationFlow flow() {
return IntegrationFlows.from(Http.inboundGateway("/foo")
.requestMapping(m -> m.methods(HttpMethod.POST)
.transform(Transformers.objectToString())
.enrichHeaders(h -> h.headerExpression())
.transform(new ObjectTransformation()).wireTap("subChannel")
.get();
}
我也制作了一个订阅频道,也是一个loggerhandler
@Bean
public SubscribableChannel subscribeChannel() {
return MessageChannels.publishSubscribe("subChannel")
.get();
}
public LoggingHandler logger() {
LoggingHandler logger = new LoggingHandler(Level.INFO);
return logger;
}
,我还创建了一个流程来记录复制数据:
@Bean
public IntegrationFlow subscribeFlow() {
return IntegrationFlows.from("subChannel")
.handle(logger()).get();
}
我遇到了一个没有答复的错误:
org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 : "No reply received within timeout"
我不知道它是错误的,任何解决方案?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决方案
我在流程末端使用窃听()的事实使流程出错,因为默认情况没有回复。因此,我不得不将.bridge()添加到流中。
流应该如下:
检查此帖子
https://stackoverflow.com/questions/62673629/timeout-timeout-on-replychannel-when-when-wiretap-is-used#:~: text= thex;
Solution
The fact that i am using the wireTap() at the end of the flow makes the flow goes wrong, because there is no reply on default. so i had to add .bridge() to the flow.
The flow should be as below :
check this post
https://stackoverflow.com/questions/62673629/timeout-on-replychannel-when-wiretap-is-used#:~:text=The%20behavior%20is,more%20in%20docs