A basic websocket supplier that produced messages through web socket.
The Supplier
uses the WebsocketInboundChannelAdapter
from Spring Integration.
This supplier gives you a reactive stream of messages and the supplier has a signature of Supplier<Flux<Message<?>>>
.
Users have to subscribe to this Flux
and receive the data.
The WebsocketSupplierConfiguration
auto-configuration provides the following bean:
websocketSupplier
You need to inject this as Supplier<Flux<Message<?>>>
.
You can use websocketSupplier
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 websocket.supplier
.
For more information on the various options available, please see WebsocketSupplierProperties.
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 a File Source.