fineconstant / spring-boot-2-reactive

Demo project for Spring 5 and Reactor with Angular and RxJs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reactive programming demo

Profiled with jprofiler Java profiler.

  • How to run?

    For the best experience import with IntelliJ.

    Execute in this order:

    1. Run isp.example.service.ReactiveServiceApplication - A Service application
    2. Run isp.example.client.ReactiveClientApplication - A Spring backend client application
    3. In order to start reactive front-end Angular application (requires node and npm):
      • Run cd reactive-front
      • Run npm install
      • Run npm start
    4. Observe logs of all the applications!
  • What is inside?

    • ReactiveServiceApplication contains localhost:8080 reactive endpoints:
      • /event - an infinite stream of events
      • /event{id} - get a specific event by id
      • /users - get a collection of all users
      • /users{id} - get a specific user by id
      • /users/count - get count of all users
      • /users/by_name/{name} - get a collection of users with a specified name
    • ReactiveClientApplication is a command line Spring application that uses Spring's new reactive web client to read events from the Service's /events endpoint.
    • Reactive Angular client under localhost:3000
      • As of today (Jun 7, 2017), RsJs has some problems with SSE (Server Side Events). See: ReactiveX/rxjs#1644
      • TypeScript has no EventSource definition. See: microsoft/TypeScript#13666
      • Temporary workaround: using pure JavaScript EventSource implementation.
  • Used in this project:

  • More examples of operators in src/test/java

  • Also worth checking:

  • To do:

    • Consuming events with TypeScript and RxJs
    • Format output date

About

Demo project for Spring 5 and Reactor with Angular and RxJs


Languages

Language:JavaScript 49.0%Language:Java 36.4%Language:TypeScript 11.0%Language:HTML 3.4%Language:CSS 0.3%