I've a requirement to download a file from S3 based on a message content. In other words, the file to download is previously unknown, I've to search and find it at runtime. S3StreamingMessageSource doesn't seem to be a good fit because:
- It relies on polling where as I need to wait for the message.
- I can't find any way to create a
S3StreamingMessageSource
dynamically in the middle of a flow.gateway(IntegrationFlow)
looks interesting but what I need is agateway(Function<Message<?>, IntegrationFlow>)
that doesn't exist.
Another candidate is S3MessageHandler but it has no support for listing files which I need for finding the desired file.
I can implement my own message handler using AWS API directly, just wondering if I'm missing something, because this doesn't seem like an unusual requirement. After all, not every app just sits there and keeps polling S3 for new files.