即使请求失败,Spring Integration也会遇到多个出站请求

时间:2019-02-08 19:34:56

标签: spring-integration-dsl

@Bean
public IntegrationFlow initiateFlowGeocode3() {
    RestTemplate restTemplate = new RestTemplate();
    restTemplate.setRequestFactory(requestFactory());
    System.out.println("**********in flow3");
    return IntegrationFlows.from("FlowChannel2").transform(Transformers.toJson()).log("IN  GATEWAY 3 !").handle(
            Http.outboundGateway("URL",
                    restTemplate).charset("UTF-8").httpMethod(HttpMethod.GET).expectedResponseType(String.class)
                   .errorHandler(new MyResponseErrorHandler()))
            .log("after the rest api call3 ").transform(new JsonToObjectTransformer(RestClientBean.class)).get();
}

@Bean
public IntegrationFlow errorResponse() {
    return IntegrationFlows.from(renewalErrorChannel()).log("ERROR FLOW TRIGGERED").get();
}

@Bean
public PollableChannel renewalErrorChannel() {
    return new QueueChannel();
}

不断受到打击。如果发生故障,该流应停止击中它,但它会不断轮询故障请求。可以停止轮询请求吗?

0 个答案:

没有答案