https://github.com/baratharivazhagan/spring-web-flux-reactive-types
Learning of reactive types Mono and Flux.
https://github.com/baratharivazhagan/spring-web-flux-reactive-types
reactor reactor3 spring-boot spring5
Last synced: 2 months ago
JSON representation
Learning of reactive types Mono and Flux.
- Host: GitHub
- URL: https://github.com/baratharivazhagan/spring-web-flux-reactive-types
- Owner: BarathArivazhagan
- Created: 2017-09-05T05:59:17.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-06-30T17:07:04.000Z (almost 6 years ago)
- Last Synced: 2025-03-16T02:04:30.790Z (3 months ago)
- Topics: reactor, reactor3, spring-boot, spring5
- Language: Java
- Homepage:
- Size: 52.7 KB
- Stars: 4
- Watchers: 0
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# spring-web-flux-reactive-types
This repository breaks down learning of reactive types such as Mono and Flux. This repository contains examples using these reactive types in Spring5 Web Flux Framework## Documentation:
#### What is a Reactor ?
Reactor = single threaded event loop that receives and processes requests.
#### What is Reactor Pattern ?
The reactor design pattern is an event handling pattern for handling service requests delivered concurrently to a service handler by one or more inputs. The service handler then demultiplexes the incoming requests and dispatches them synchronously to the associated request handlers.
## REST endpoint mappings:
Endpoint
Description
/flux/strings
returns flux of strings created using Flux.just()
/flux/fromArray
returns flux of strings created using Flux.fromArray()
/flux/concat
returns flux of strings created using Flux.concat()
/flux/merge
returns flux of strings created using Flux.merge()
/mono/string
returns mono of type string Mono.just()
/mono/string/delay
returns flux of strings created using Flux.just()
/mono/doOnNext
returns flux of strings created using Mono.just().doOnNext()
/mono/int
returns flux of strings created using Mono.just()
/flux/user/one
returns flux of one user created using Flux.just()
/flux/user/many
returns flux of many users created using Flux.just()
/flux/fromIterable
returns flux of strings created using Flux.fromIterable()
/mono/user
returns mono of user using Mono.just(new User())
/mono/toFlux
convert Mono to Flux by calling mono.flux()
### How to build and run the project?
1) Clone the repository
2) Maven build```
./mvnw clean install
```3) Run as spring boot app:
```
./mvnw spring-boot:run
```References:
* http://musigma.org/java/2016/11/21/reactor.html
* http://javasampleapproach.com/reactive-programming/reactor/reactor-how-to-combine-flux-mono-reactive-programming