This repository contains the projects that are demoed during the breakout discussion. These projects are meant to provide a quick start for experimenting with various features of Spring Cloud Function and Spring Cloud Stream All samples use RabbitMQ as the Messaging Framework.
A collection of functions that can be used with the Producer, Function, and Consumer portions demonstration
A boot application that will retrieve the creek data from the USGS for a selected set of creeks and send it to the specified destination (rabbit exchange).
A boot application transforms USGS Water Information System data to CreekMeasurements
s.
A boot application that will consume the CreekMeasurement
s from the stream and either log or send an sms message containing information on the creeks that are safe-ish to kayak from the provided data.
Note
|
Do not determine if it is safe to kayak a stream, river, or any body of water based soley on the this analysis. It is for demonstration purposes only. |
A boot application that will consume the CreekMeasurement
s from the stream and store them into a repository.
This will send the report to the specified phone number . You must also provide the sms key.
java -jar creekconsumer/target/creekconsumer-0.0.1-SNAPSHOT.jar --spring.cloud.function.definition='generateReport|sms' --spring.cloud.stream.function.bindings.generateReportsms-in-0=input --spring.cloud.stream.bindings.input.group=sms --io.spring.smsKey=yourkey --io.spring.phoneNumber=+1XXXXXXXXXX
You can run the following script to build all the projects' docker images by running the following script:
./create-images.sh
Or your can build each of the projects below independently as follows:
Build the docker images per Project:
cd creekconsumer
./mvnw spring-boot:build-image -Dspring-boot.build-image.imageName=creek-consumer
cd creekproducer
./mvnw spring-boot:build-image -Dspring-boot.build-image.imageName=creek-producer
creektransformer
cd creektransformer ./mvnw spring-boot:build-image -Dspring-boot.build-image.imageName=creek-transformer
cd creekmeasurementrepositoryconsumer
./mvnw spring-boot:build-image -Dspring-boot.build-image.imageName=creek-storage
Now, you can use the following docker-compose.yml
file and execute:
link:docker-compose.yml[role=include]
docker-compose up
You can open your browser the RabbitMQ Console to see the Exchanges and Queues created.
The port 3306
is exposed, so you can use a SQL Client for a MySQL/MariaDB and see the Table and data that stores the creek results.