1
@SpringBootApplication
@EnableIntegration
public class SpringIntegrationHttpApplication {

public static void main(String[] args) {
    SpringApplication.run(SpringIntegrationHttpApplication.class, args);
}

@Bean
public HttpRequestHandlerEndpointSpec httpInboundAdapter() {
    return Http
            .inboundChannelAdapter("/failing-test")
            .requestMapping(r -> r.methods(HttpMethod.GET)
                    .params("rObjectId"))
            .payloadExpression("#requestParams.rObjectId[0]")
            ;
}

@Bean
public IntegrationFlow myFlow() {
    return IntegrationFlows.from(Http
                    .inboundChannelAdapter("/test")
                    .requestMapping(r -> r.methods(HttpMethod.GET)
                    .params("rObjectId"))
            .payloadExpression("#requestParams.rObjectId[0]"))
            .transform(p -> p)
            .handle(p -> System.out.println(p))
            .get();
}

@Bean
public IntegrationFlow yourFlow() {
    return IntegrationFlows.from(httpInboundAdapter())
            .transform(p -> p)
            .handle(p -> System.out.println(p))
            .get();
}
}

For the above code, the link: /test works but not /failing-test. I get "Endpoint is stopped" on chrome.

What might be the reason?

Guru
  • 2,739
  • 1
  • 25
  • 27

1 Answers1

1

I am not sure why, yet, but remove the @Bean from the spec (just use a simple method that returns the Spec).

Gary Russell
  • 166,535
  • 14
  • 146
  • 179