Skip to content

vasilhsfoto/library-reactive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Web Flux Rest API in action 🚀

Implementing a Rest API using Spring Web Flux

Spring Web Flux is a fully non-blocking web framework on top of Spring Reactor project By default it runs on Netty.

Usage

Java 8 > is required

  • Run the CB server
 ./bin/cbRunLocally.sh start
  • Run the Application

Things to remember - Notes

  • We still use Controller annotations for mapping request to responses
  • Controller returned Mono<ResponseEntity<?>>. Note: we have 2 options when we use Controllers - either Mono<ResponseEntity<>> or Mono/Flux. If you use Controllers together with ServerResponse u get error
  • if you use any blocking operation in your nio thread => IllegalStateException e.g given a Mono feed you do feed.block() or given a Flux feed you do feed.toIterable/toStream
  • if you try to subscribe to any pipeline you build => error some things like reading from inputstream can't happen twice
  • For debugging you can use log/onNextElement

About

POC Rest API using Web Flux

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published