Getting a "BlockingNotAllowedException" exception message in Red Hat Quarkus Application when reading from "InputStream"
Issue
-
Trying to read from the
InputStreamof theContainerRequestContextwhile filtering requests constantly gets:BlockingNotAllowedException: Attempting a blocking read on io thread -
Here is a code snippet where this happens:
@Provider @PreMatching public class TestFilter implements ContainerRequestFilter { @Context HttpServerRequest request; @Override public void filter(ContainerRequestContext containerRequestContext) throws IOException { containerRequestContext.getEntityStream().readAllBytes(); //TODO: Edit the request body } }
Environment
- Red Hat build of Quarkus
- 3.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.