Skip to content

Latest commit

 

History

History
37 lines (22 loc) · 1.85 KB

File metadata and controls

37 lines (22 loc) · 1.85 KB

FTP Supplier

This module provides a FTP supplier that can be reused and composed in other applications. The Supplier uses the FtpInboundChannelAdapter from Spring Integration. FtpSupplier is implemented as a java.util.function.Supplier. This supplier gives you a reactive stream of files from the provided directory as the supplier has a signature of Supplier<Flux<Message<?>>>. Users have to subscribe to this Flux and receive the data.

Beans for injection

You can import the FtpSupplierConfiguration in the application and then inject the following bean.

ftpSupplier

You need to inject this as Supplier<Flux<Message<?>>>.

You can use ftpSupplier as a qualifier when injecting.

Once injected, you can use the get method of the Supplier to invoke it and then subscribe to the returned Flux.

Configuration Options

All configuration properties are prefixed with ftp.supplier. There are also properties that need to be used with the prefix file.consumer.

For more information on the various options available, please see FtpSupplierProperties. See this also.

A ComponentCustomizer<FtpInboundChannelAdapterSpec> bean can be added in the target project to provide any custom options for the FtpInboundChannelAdapterSpec configuration used by the ftpSupplier.

Tests

See this test suite for the various ways, this supplier is used.

Other usage

See this README where this supplier is used to create a Spring Cloud Stream application where it makes a File Source.