A consumer that allows you to write incoming messages into files.
The consumer uses the FileWritingMessageHandler
from Spring Integration.
You can import FileConsumerConfiguration
in the application and then inject the following bean.
Consumer<Message<?>> fileConsumer
You can use fileConsumer
as a qualifier when injecting.
All configuration properties are prefixed with file.consumer
.
For more information on the various options available, please see FileConsumerProperties.
A ComponentCustomizer<FileWritingMessageHandler>
bean can be added in the target project to provide any custom options for the FileWritingMessageHandler
configuration used by the fileConsumer
.
See this test suite for the various ways, this consumer is used.
See this README where this consumer is used to create a Spring Cloud Stream application where it makes a File sink.