code: @Override
    public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
      try {
        if (exceptionRaised.get()) {
          return;
        }
  
        if (!(msg instanceof HttpRequest)) {
          // If there is no methodInfo, it means the request was already rejected.
          // What we received here is just residue of the request, which can be ignored.
          if (methodInfo != null) {
            ReferenceCountUtil.retain(msg);
            ctx.fireChannelRead(msg);
          }
          return;
        }
        HttpRequest request = (HttpRequest) msg;
        BasicHttpResponder responder = new BasicHttpResponder(ctx.channel(), sslEnabled);
  
        // Reset the methodInfo for the incoming request error handling
        methodInfo = null;
        methodInfo = prepareHandleMethod(request, responder, ctx);
  
        if (methodInfo != null) {
          ReferenceCountUtil.retain(msg);
          ctx.fireChannelRead(msg);
        } else {
          if (!responder.isResponded()) {
            // If not yet responded, just respond with a not found and close the connection
            HttpResponse response = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.NOT_FOUND);
            HttpUtil.setContentLength(response, 0);
            HttpUtil.setKeepAlive(response, false);
            ctx.channel().writeAndFlush(response).addListener(ChannelFutureListener.CLOSE);
          } else {
            // If already responded, just close the connection
            ctx.channel().close();
          }
        }
      } finally {
        ReferenceCountUtil.release(msg);
      }
    }
docs: If the HttpRequest is valid and handled it will be sent upstream, if it cannot be invoked
  the response will be written back immediately.