0

spring cloud dataflow sftp source starter app states that file name should be in the headers (mode=contents). However, when I connect this source to a log sink, I see a few headers (like Content-Type) but not the file_name header. I want to use this header to upload the file to S3 with the same name.

spring server: Spring Cloud Data Flow Local Server (v1.2.3.RELEASE)

my apps are all imported from here

stream definition: stream create --definition "sftp --remote-dir=/incoming --username=myuser --password=mypwd --host=myftp.company.io --mode=contents --filename-pattern=preloaded_file_2017_ --allow-unknown-keys=true | log" --name test_sftp_log

configuring the log application to --expression=#root --level=debug doesn't make any difference. Also, writing my own sink that tries to access the file_name header I get an error message that such header does not exist

logs snippets from the source and sink are in this gist

polo
  • 1,352
  • 2
  • 16
  • 35

1 Answers1

1

Please follow this link bellow, You need to code your own Source and populate such a header manually downstream already after FileReadingMessageSource. And only after that send the message with content and appropriate header to the target destination. https://github.com/spring-cloud-stream-app-starters/file/issues/9

Brijesh
  • 23
  • 6