- Candidate libs for light & modern REST server
- Selection criteria
- Best options for 2023
- Container friendly
- Light on memory
- Library, not a framework
- Graal & native-image friendly
- Dependency injection friendly
- Simple routing
- Filters/Middleware
- Simple parameter mapping
- No scala (memory hungry, tomorrow's abandonware)
- Minimal runtime magic (reflection)
- Non-blocking IO (eg. netty based)
- No
Reactor/RxJava(memory hungry, complex, infectious)- Mono and Flux take over all your function signatures
- JDBC is still blocking so there's no value in contaminating your API
- Project loom obsoletes reactive programming
- HTTP/2 support
- OpenTelemetry friendly
- Best fit
- Optional Servlet 5.x support
- TODO
Con: smaller community than jetty
- TODO
Pro: minimal dependencies
- Framework, not a library
- If it doesn't do exactly what you want, you are out of luck (same for most frameworks)
- You are locked into what they can provide (same for most frameworks)
- CDI for injection (cannot replace with Guice nor spring-context)
- vertx based (see below)
- Tightly coupled to popular frameworks
- They manually build "adapters" (only) to popular frameworks
- Reactive programming (see above)
- Eclipse micro profile for metrics
- Coroutines support isn't core
- Abandonware (last updated 2018)
- Abandonware (last updatd 2014)
- Overly complex
- Heavy on reflection
- Abandonware (They are pushing webflux instead)
- Lots of magic
- Following stack traces is hard
- Reasoning about control flow is hard
- Heavy memory footprint
- Reactive programming (see above)
- Heavy on reflection
- Most of the same problems as Spring Web
- Not graal & native-image friendly
- lots of warning & error messages
- Too heavy
- Overhead for supporting too many abandoned/legacy technologies
- Vertx doesn't help with non-blocking code
- They tell YOU not to write blocking code
- If you have to do the work, you don't need vertx
- Callback hell
- Not even lambda friendly
- asynchronous is undesirable, because it doesn't compose, isn't traceable via source, ...
- Immature EventBus
- SerDe performance overhead in both directions
- Loss of type safety at the EventBus (no refactoring, performance overhead)
- no bus retry
- no bus persistence
- no bus guarantees
- Non-blocking "lie" breaks at the SQL layer since JDBC is a blocking API
- No composition (verticles are not composable)
- Debugging is hard
- Non-trivial flows require following things thru the bus