1

Is there any working example for file writing support of the Spring Integration DSL? I cannot find anything about DSL implementation.(e.g. a handle() step in the integration flow, etc.) Thanks.

gbalcisoy
  • 117
  • 3
  • 17

1 Answers1

2

There is a sample in the Reference Manual:

@Bean
public IntegrationFlow fileWritingFlow() {
    return IntegrationFlows.from("fileWritingInput")
            .enrichHeaders(h -> h.header(FileHeaders.FILENAME, "foo.txt")
                      .header("directory", new File(tmpDir.getRoot(), "fileWritingFlow")))
            .handle(Files.outboundAdapter(m -> m.getHeaders().get("directory")))
            .channel(MessageChannels.queue("fileWritingResultChannel"))
            .get();
}

The File-Split-FTP may give you some insights too.

Artem Bilan
  • 113,505
  • 11
  • 91
  • 118