Soby Chacko
2020-05-27 13:21:53 -04:00
committed by GitHub
parent 7a3189a6c2
commit bdbe8bc231
7 changed files with 235 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
# File Supplier
This module provides a File supplier that can be reused and composed in other applications.
The `Supplier` uses the `FileInboundChannelAdapter` from Spring Integration.
`FileSupplier` 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 `FileSupplierConfiguration` in the application and then inject the following bean.
`fileSupplier`
You need to inject this as `Supplier<Flux<Message<?>>>`.
You can use `fileSupplier` 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 `file.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 https://github.com/spring-cloud/stream-applications/blob/master/functions/supplier/file-supplier/src/main/java/org/springframework/cloud/fn/supplier/file/FileSupplierProperties.java[FileSupplierProperties].
See https://github.com/spring-cloud/stream-applications/blob/master/functions/supplier/file-supplier/src/main/java/org/springframework/cloud/fn/supplier/file/FileConsumerProperties.java[this] also.
## Tests
See this https://github.com/spring-cloud/stream-applications/tree/master/functions/supplier/file-supplier/src/test/java/org/springframework/cloud/fn/supplier/file[test suite] for the various ways, this supplier is used.
## Other usage
See this https://github.com/spring-cloud/stream-applications/blob/master/applications/source/file-source/README.adoc[README] where this supplier is used to create a Spring Cloud Stream application where it makes a File Source.

View File

@@ -0,0 +1,33 @@
# HTTP Supplier
This module provides an HTTP supplier that can be reused and composed in other applications.
The `Supplier` uses the `WebFluxInboundEndpoint` from Spring Integration.
`httpSupplier` is implemented as a `java.util.function.Supplier`.
This supplier gives you a reactive stream from the http endpoint. The supplier has a signature of `Supplier<Flux<Message<byte[]>>>`.
Users have to subscribe to this `Flux` and then receive the data.
## Beans for injection
You can import the `HttpSupplierConfiguration` in the application and then inject the following bean.
`httpSupplier`
You need to inject this as `Supplier<Flux<Message<byte[]>>>`.
You can use `httpSupplier` 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 `http`.
For more information on the various options available, please see https://github.com/spring-cloud/stream-applications/blob/master/functions/supplier/http-supplier/src/main/java/org/springframework/cloud/fn/supplier/http/HttpSupplierProperties.java[FileSupplierProperties].
## Tests
See this https://github.com/spring-cloud/stream-applications/blob/master/functions/supplier/http-supplier/src/test/java/org/springframework/cloud/fn/supplier/http/HttpSupplierApplicationTests.java[test suite] for the various ways, this supplier is used.
## Other usage
See this https://github.com/spring-cloud/stream-applications/blob/master/applications/source/http-source/README.adoc[README] where this supplier is used to create a Spring Cloud Stream application where it makes an HTTP Source.

View File

@@ -0,0 +1,34 @@
# JDBC Supplier
This module provides a JDBC supplier that can be reused and composed in other applications.
The `Supplier` uses the `JdbcPollingChannelAdapter` from Spring Integration.
`JdbcSupplier` is implemented as a `java.util.function.Supplier`.
When you have use-cases such as periodical execution of a Database query, based on some external trigger such as a REST endpoint call for example, then you can use this `Supplier` to query the underlying relational database.
## Beans for injection
You can import the `JdbcSupplierConfiguration` in the application and then inject the following bean.
`jdbcSupplier`
You can inject it as `Supplier<Message<?>` when you are not splitting the rows.
If you are splitting the output, you need to inject this as `Supplier<Flux<Message<?>>>`.
You can use `jdbcSupplier` as a qualifier when injecting.
Once injected, you can use the `get` method of the `Supplier` to invoke it.
In the case of splitting you get a `Flux` which you have to subscribe in your applications.
## Configuration Options
All configuration properties are prefixed with `jdbc.supplier`.
For more information on the various options available, please see https://github.com/spring-cloud/stream-applications/blob/master/functions/supplier/jdbc-supplier/src/main/java/org/springframework/cloud/fn/supplier/jdbc/JdbcSupplierProperties.java[JdbcSupplierProperties]
## Tests
See this https://github.com/spring-cloud/stream-applications/tree/master/functions/supplier/jdbc-supplier/src/test/java/org/springframework/cloud/fn/supplier/jdbc[test suite] for the various ways, this supplier is used.
## Other usage
See this https://github.com/spring-cloud/stream-applications/blob/master/applications/source/jdbc-source/README.adoc[README] where this supplier is used to create a Spring Cloud Stream application where it makes a JDBC Source.

View File

@@ -0,0 +1,34 @@
# MongoDB Supplier
This module provides a MongoDB supplier that can be reused and composed in other applications.
The `Supplier` uses the `MongoDBMessageSource` from Spring Integration.
`MongoDBSupplier` is implemented as a `java.util.function.Supplier`.
When you have use-cases such as periodical execution of querying MongoDB, based on some external trigger such as a REST endpoint call for example, then you can use this `Supplier` to query.
## Beans for injection
You can import the `MongoDBSupplierConfiguration` in the application and then inject the following bean.
`mongoDBSupplier`
You can inject it as `Supplier<Message<?>` when you are not splitting the rows.
If you are splitting the output, you need to inject this as `Supplier<Flux<Message<?>>>`.
You can use `mongoDBSupplier` as a qualifier when injecting.
Once injected, you can use the `get` method of the `Supplier` to invoke it.
In the case of splitting you get a `Flux` which you have to subscribe in your applications.
## Configuration Options
All configuration properties are prefixed with `mongodb.supplier`.
For more information on the various options available, please see https://github.com/spring-cloud/stream-applications/blob/master/functions/supplier/mongodb-supplier/src/main/java/org/springframework/cloud/fn/supplier/mongo/MongodbSupplierProperties.java[MongoDBSupplierProperties]
## Tests
See this https://github.com/spring-cloud/stream-applications/blob/master/functions/supplier/mongodb-supplier/src/test/java/org/springframework/cloud/fn/supplier/mongo/MongodbSupplierApplicationTests.java[test suite] for the various ways, this supplier is used.
## Other usage
See this https://github.com/spring-cloud/stream-applications/blob/master/applications/source/mongodb-source/README.adoc[README] where this supplier is used to create a Spring Cloud Stream application where it makes a MongoDB Source.

View File

@@ -0,0 +1,34 @@
# MQTT Supplier
This module provides an MQTT supplier that can be reused and composed in other applications.
The `Supplier` uses the `MqttPahoMessageDrivenChannelAdapter` from Spring Integration.
`mqttSupplier` is implemented as a `java.util.function.Supplier`.
This supplier gives you a reactive stream from MQTT sources. The supplier has a signature of `Supplier<Flux<Message<?>>>`.
Users have to subscribe to this `Flux` and then receive the data.
## Beans for injection
You can import the `MqttSupplierConfiguration` in the application and then inject the following bean.
`mqttSupplier`
You need to inject this as `Supplier<Flux<Message<?>>>`.
You can use `mqttSupplier` 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 `mqtt.supplier` and `mqtt`.
For more information on the various options available, please see https://github.com/spring-cloud/stream-applications/blob/master/functions/supplier/mqtt-supplier/src/main/java/org/springframework/cloud/fn/supplier/mqtt/MqttSupplierProperties.java[MqttSupplierProperties].
## Tests
See this https://github.com/spring-cloud/stream-applications/blob/master/functions/supplier/mqtt-supplier/src/test/java/org/springframework/cloud/fn/supplier/mqtt/MqttSupplierTests.java[test suite] for the various ways, this supplier is used.
In addition to this, there is also https://github.com/spring-cloud/stream-applications/blob/master/functions/common/mqtt-common/src/main/java/org/springframework/cloud/fn/common/mqtt/MqttProperties.java[this set of properties] to consider.
## Other usage
See this https://github.com/spring-cloud/stream-applications/blob/master/applications/source/mqtt-source/README.adoc[README] where this supplier is used to create a Spring Cloud Stream application where it makes an MQTT Source.

View File

@@ -0,0 +1,34 @@
# TCP Supplier
This module provides a TCP supplier that can be reused and composed in other applications.
The `Supplier` uses the `TcpReceivingChannelAdapter` from Spring Integration.
`tcpSupplier` 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.
## Beans for injection
You can import the `TcpSupplierConfiguration` in the application and then inject 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`.
## Configuration Options
All configuration properties are prefixed with `tcp.supplier` and `tcp`.
For more information on the various options available, please see https://github.com/spring-cloud/stream-applications/blob/master/functions/supplier/tcp-supplier/src/main/java/org/springframework/cloud/fn/supplier/tcp/TcpSupplierProperties.java[TcpSupplierProperties].
In addition to this, there is also https://github.com/spring-cloud/stream-applications/blob/master/functions/common/tcp-common/src/main/java/org/springframework/cloud/fn/common/tcp/TcpConnectionFactoryProperties.java[this set of properties] to consider.
## Tests
See this https://github.com/spring-cloud/stream-applications/tree/master/functions/supplier/tcp-supplier/src/test/java/org/springframework/cloud/fn/supplier/tcp[test suite] for the various ways, this supplier is used.
## Other usage
See this https://github.com/spring-cloud/stream-applications/blob/master/applications/source/tcp-source/README.adoc[README] where this supplier is used to create a Spring Cloud Stream application where it makes an TCP Source.

View File

@@ -0,0 +1,31 @@
# Time Supplier
This module provides a Time supplier that can be reused and composed in other applications.
The `Supplier` uses the `FastDateFormat` from Apache Commons library.
`timeSupplier` is implemented as a `java.util.function.Supplier`.
## Beans for injection
You can import the `TimeSupplierConfiguration` in the application and then inject the following bean.
`timeSupplier`
You need to inject this as `Supplier<String>`.
You can use `timeSupplier` as a qualifier when injecting.
Once injected, you can use the `get` method of the `Supplier` to invoke it.
## Configuration Options
All configuration properties are prefixed with `time`.
For more information on the various options available, please see https://github.com/spring-cloud/stream-applications/blob/master/functions/supplier/time-supplier/src/main/java/org/springframework/cloud/fn/supplier/time/TimeSupplierProperties.java[TimeSupplierProperties].
## Tests
See this https://github.com/spring-cloud/stream-applications/tree/master/functions/supplier/time-supplier/src/test/java/org/springframework/cloud/fn/supplier/time[test suite] for the various ways, this supplier is used.
## Other usage
See this https://github.com/spring-cloud/stream-applications/blob/master/applications/source/time-source/README.adoc[README] where this supplier is used to create a Spring Cloud Stream application where it makes an Time Source.