0

I have a Spring Integration route (made via DSL) that polls the files from a specific folder (as shown in Polling from file using Java DSL - compile error when adding Files.inboundAdapter) and sends to Rabbit.

When I configured the flow as explained in the link above, it starts on configuration stage already. I, however, would like to start it in runtime, later, since I need to connect to Rabbit first.

How can I configure IntegrationFlow to be started/stopped later on demand?

Gary Russell
  • 166,535
  • 14
  • 146
  • 179
onkami
  • 8,791
  • 17
  • 90
  • 176

1 Answers1

2

Add autoStartup(false).

e -> e.poller(Pollers.fixedDelay(5000))
      .autoStartup(false)

then flow.start() when you are ready.

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