README.md
March 2, 2019 ยท View on GitHub
Reactive programming demo
Profiled with
Java profiler.
-
How to run?
For the best experience import with IntelliJ.
Execute in this order:
- Run
isp.example.service.ReactiveServiceApplication- A Service application - Run
isp.example.client.ReactiveClientApplication- A Spring backend client application - In order to start reactive front-end Angular application (requires node and npm):
- Run
cd reactive-front - Run
npm install - Run
npm start
- Run
- Observe logs of all the applications!
- Run
-
What is inside?
- ReactiveServiceApplication contains
localhost:8080reactive 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
/eventsendpoint. - Reactive Angular client under
localhost:3000- As of today (Jun 7, 2017), RsJs has some problems with SSE (Server Side Events). See: https://github.com/ReactiveX/rxjs/issues/1644
- TypeScript has no EventSource definition. See: https://github.com/Microsoft/TypeScript/issues/13666
- Temporary workaround: using pure JavaScript EventSource implementation.
- ReactiveServiceApplication contains
-
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