简体   繁体   中英

Spring Cloud Dataflow file starter modification

I'm in the process of modifying this starter to suite my requirements:

https://github.com/spring-cloud-stream-app-starters/file/blob/master/spring-cloud-starter-stream-source-file/src/main/java/org/springframework/cloud/stream/app/file/source/FileSourceConfiguration.java

I'm trying to tap into the actual file that's being created in the folder the app is polling from and I wanna persist metadata about the file (and make certain decisions based on it) before it's being passed on to the output channel. Eg looking at the tests, ContentPayloadTests.testSimpleFile() i wanna be able to access the test.txt file before a Message is generated and posted on the source.output() channel.

Any help is appreciated! Thanks!

The solution was to implement a ChannelInterceptor interface's preSend method..

https://docs.spring.io/spring-integration/archive/1.0.0.M6/reference/html/ch02s05.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM