Reactive servlets

Hookless » Adapters » Servlets

Reactive servlet as implemented in ReactiveServlet class is a reactive adapter for Jakarta's HttpServlet. Reactive servlet is a reactive consumer. It will keep running its handler method until the handler no longer reactively blocks. It will then send the last output of the handler to the client as an HTTP response. Reactive servlet is fully asynchronous. It never blocks servlet container threads.


Get Hookless Servlets from Maven Central:


Or clone sources from GitHub or Bitbucket. Configure your build for Java 17+. Reactive servlets target Jakarta Servlet API 5, which means they will run on any Jakarta EE 9+ servlet container. Sources and binaries are distributed under Apache License 2.0.

If your project is a Java module, add the following declaration to your

requires com.machinezoo.hookless.servlets;


See servlets package, particularly ReactiveServlet class. Since the javadoc is not complete yet, you might want to take a look at comments and implementation in sources.