Coder Social home page Coder Social logo

scstdn2022's Introduction

Spring Cloud Stream Past, Present, and Future.

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.

Projects

Creek Functions

A collection of functions that can be used with the Producer, Function, and Consumer portions demonstration

Creek Producer

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).

Creek Transformer

A boot application transforms USGS Water Information System data to CreekMeasurements s.

Creek Consumer

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.

Creek MeasurementRepository Consumer

A boot application that will consume the CreekMeasurement s from the stream and store them into a repository.

Stream POC

Single App POC that is used as a basic outline for the demo.

SCSt
Figure 1. Process Flow

Running the full demo

Start the consumers

Send Creek Report via SMS

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
Write Creek Report to console

This will write the report to the console.

java -jar creekconsumer/target/creekconsumer-0.0.1-SNAPSHOT.jar

Start the transformer

java -jar creektransformer/target/creektransformer-0.0.1-SNAPSHOT.jar

Start the Producer

java -jar creekproducer/targecreekproducer-0.0.1-SNAPSHOT.jar

Using Docker and Docker Compose

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:

creekconsumer
cd creekconsumer
./mvnw spring-boot:build-image -Dspring-boot.build-image.imageName=creek-consumer
creekproducer
cd creekproducer
./mvnw spring-boot:build-image -Dspring-boot.build-image.imageName=creek-producer
[source,bash]

creektransformer

cd creektransformer
./mvnw spring-boot:build-image -Dspring-boot.build-image.imageName=creek-transformer
creekmeasurementrepositoryconsumer
cd creekmeasurementrepositoryconsumer
./mvnw spring-boot:build-image -Dspring-boot.build-image.imageName=creek-storage

Using docker-compose to launch the services.

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.

Cleaning up

In another window and in the same folder where you ran the docker-compose command, you can run:

docker-compose down

scstdn2022's People

Contributors

cppwfs avatar felipeg48 avatar olegz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.