GithubHelp home page GithubHelp logo

event-streaming-demo's Introduction

Pre-requisites

curl -O http://repo.spring.io/milestone/org/springframework/cloud/stream/app/jdbc-source-kafka/2.1.0.RC1/jdbc-source-kafka-2.1.0.RC1.jar
curl -O http://repo.spring.io/milestone/org/springframework/cloud/stream/app/file-sink-kafka/2.1.0.RC1/file-sink-kafka-2.1.0.RC1.jar

Starting Up

Startup at the end first so that your consumers are consuming before messages arrive

  1. Start Kafka and Postgres DB - in the root project folder is a docker-compose.yml run

    $ docker-compose up -d
    
  2. Start the file sink

    java -jar file-sink-kafka-2.1.0.RC1.jar \
    --server.port=0 \
    --spring.cloud.stream.bindings.input.destination=order_customers \
    --file.mode=APPEND \
    --file.directory=output \
    --file.name=communications.log 
    
  3. Start the cloudstream dg.demo.cloudstream.Application with these extra program arguments --spring.mail.username=<mailtrap user> --spring.mail.password=<mailtrap password>

    If you are using a different mail server edit the application.yml to set settings accordingly.

  4. Start the ordersimulator dg.demo.ordersimulator.Application with the extra program argument --server.port=0 so it runs on a different port than the demo application

  5. Start the JDBC source

    java -jar jdbc-source-kafka-2.1.0.RC1.jar \
    --server.port=0 \
    --spring.cloud.stream.bindings.output.destination=order_customers \
    --jdbc.query="select o.order_number,o.customer_email,sa.first_name,last_name,sa.street,sa.city,sa.state,sa.zip from orders o inner join shipping_address sa on o.shipping_address_shipping_address_id = sa.shipping_address_id where o.processed=false" \
    --jdbc.update="update orders set processed=true where order_number in (:order_number)" \
    --spring.datasource.url=jdbc:postgresql://localhost/postgres \
    --spring.datasource.username=postgres \
    --spring.datasource.password=mypassword
    

event-streaming-demo's People

Contributors

dgradl-fl avatar

Watchers

Dan Gradl avatar James Cloos avatar

Forkers

jlentzfl

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.