This module provides a TCP supplier that can be reused and composed in other applications.
The Supplier
uses the TcpReceivingChannelAdapter
from Spring Integration.
A tcpSupplier
bean is implemented as a java.util.function.Supplier
.
This supplier gives you a reactive stream from TCP sources.
The supplier has a signature of Supplier<Flux<Message<?>>>
.
Users have to subscribe to this Flux
and then receive the data.
The TcpSupplierConfiguration
auto-configuration provides the following bean: tcpSupplier
.
You need to inject this as Supplier<Flux<Message<?>>>
.
You can use tcpSupplier
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
.
All configuration properties are prefixed with tcp.supplier
and tcp
.
For more information on the various options available, please see TcpSupplierProperties. In addition to this, there is also this set of properties to consider.
See this test suite for the various ways, this supplier is used.
See this README where this supplier is used to create a Spring Cloud Stream application where it makes an TCP Source.