Search code examples
javaspringspring-bootspring-integrationspring-integration-dsl

Spring Integration DSL, poll from message channel


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()

Solution

  • figured this one out I was looking for this:

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