Spring Integration DSL, poll from message channel

Luka Špoljarić :

I have an service that sends data to an message channel. I'm wondering how can I specify integration flow to poll from that message channel every X seconds and read all the data that hasn't been read so far. I'm trying to achieve something like this:

IntegrationFlows.from("inputChannel")
    //.poll(Poller.fixedDelay(3, TimeUnit.SECONDS)))
    .handle(myGenericHandlerImpl)
    .get()
Luka Špoljarić :

figured this one out I was looking for this:

IntegrationFlows.from("inputChannel")
    .handle(myGenericHandlerImpl, e -> e.poller(Pollers.fixedDelay(3, TimeUnit.SECONDS)))
    .get()

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=146788&siteId=1