Giter VIP home page Giter VIP logo

reactive-demo's Introduction

reactive-demo

This is a demo of the Spring WebFlux module including the WebClient, with a bit of Spring Data and Spring Integration involved as well.

UPDATE: I've added the use of the Spring Reactive MongoDB. So to run the demo, first run reactive-mongo and then run reactive-client. reactive-mongo is using an embedded MongoDB database so you don't have to connect to one on your machine.

First run the reactive-sse application and in your browser go to localhost:8080/person to see Server Sent Events of Flux<List>, which is generated from the getAllPersons() method.

Go to the localhost:8080/sink endpoint next to see the same thing except this time the Server Sent Events are being sent using Spring IntegrationFlow, which is polling an H2 in memory database.

Next go and run the reactive-client application (make sure to keep the reactive-sse application running) which will start on port 8090, but you will see server sent events being sent to your console, and then two more Person objects being posted to the server and then being displayed.

It is best to either download or clone the program, git clone https://github.com/jonathanborenstein/reactive-demo.git , and then import it into your ide in order to run the program.

You can also run the program by going to each directory (reactive-demo/reactive-sse and reactive-demo/reactive-client) and run mvn clean spring-boot:run .

The demo was inspired by the Spring Tips series that Spring Advocate Josh Long does.

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.