Spring Integration HttpServerErrorException$InternalServerError: 500 : No reply received within timeout

Spring Integration HttpServerErrorException$InternalServerError: 500 : No reply received within timeout

我正在尝试使用 wireTap 将一些数据复制到另一个通道。这是我的代码:

 @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"

不知道哪里出错了,有什么解决办法吗?

解决方案 我在流程末尾使用 wireTap() 的事实使流程出错,因为默认情况下没有回复。所以我不得不将 .bridge() 添加到流程中。 流程应如下所示:

@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").bridge()
                    .get();
    }

检查这个 post