Extension for Jersey framework providing support for integrating with Reactor Mono/Flux (for example, instead of using Spring WebFlux).
Uses Jersey 3 async support with @Suspended
and AsyncResponse
Heavily inspired by and based on https://github.com/alex-shpak/rx-jersey
jersey-ext-reactor is a simple extension for Jersey which makes it possible to return Reactor types (currently Mono
and Flux
) directly from your Jersey resource endpoints while preserving asynchronous processing. This allows you to use Reactor without being stuck using Spring Webflux controllers or being resigned to add boilerplate to every resource method to subscribe to the Mono
/Flux
and interact with @Suspended AsyncResponse
explicitly.
Add the coordinates to your build.gradle file
implementation "io.github.chrisribble:jersey-reactor-server:0.0.4"
Register the feature in your Jersey config:
register(ReactorServerFeature.class);
See example directory for complete demonstration in a Spring Boot 3 application.
- Runtime: Java >= 11
- Build: Java >= 17
./gradlew build
./gradlew publishToCentralPortal -Psign=true
- Mono resource method support
- Flux resource method support (via Mono<List>)
- Flux resource method streaming support
- Client support