My usecase is like this. I want to poll a rest service periodically and use that information to call another rest service. My DSL looks like below
public IntegrationFlow flow() {
return IntegrationFlows
.from(() -> "messageSource", c -> c.poller(Pollers.fixedRate(5000).maxMessagesPerPoll(1)))
.handle(Http.outboundChannelAdapter("firstRestServiceUrl"))
.handle(Http.outboundChannelAdapter("secondRestServiceUrl")).get();
}
My problem is that the first handle method would reply back on the reply channel and the message does not travel further to the second handler.
Or is my understanding wrong? Should be using a transformer which in turn calls the firstRestServiceUrl instead of the handle method?
My understanding from the documentation is that the handle is equivalent to a Service Activator and I should be able to set the output channel as the input to my second service Activator!!
Channel adapters are one-way integrations so the flow stops at the first adapter.
You need an outbound gateway instead.